Feedback method and related device

ABSTRACT

An embodiment provides a feedback method, applied to an electronic device provided with a touchscreen. The touchscreen is provided with a plurality of vibration feedback elements. The method includes detecting a first contact operation acting on the touchscreen, and obtaining first location information of a first contact point corresponding to the first contact operation, where the first location information corresponds to a first virtual key on a virtual keyboard. The method also includes if the first virtual key is an anchor point key, obtaining, from the plurality of vibration feedback elements, a first vibration feedback element that matches the first virtual key, and indicating the first vibration feedback element to emit a vibration wave, to prompt that the first virtual key is an anchor point key, so that the user can sense a location of the anchor point key. This can reduce difficulty in implementing touch typing on the touchscreen.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation of International Application No.PCT/CN2021/141838, filed on Dec. 28, 2021, which claims priority toChinese Patent Application No. 202011628845.7, filed on Dec. 30, 2020.The disclosures of the aforementioned applications are herebyincorporated by reference in their entireties.

TECHNICAL FIELD

This application relates to the field of computer technologies, and inparticular, to a feedback method and a related device.

BACKGROUND

A most common manner of providing text input for a computer system isimplemented by using a keyboard, but the keyboard is not a very portabledevice. Therefore, a virtual keyboard is provided on a touchscreen inthe common text input manner, and a user may input texts by using thevirtual keyboard.

However, the virtual keyboard lacks many features of a physicalkeyboard. As a result, it is a difficult task to implement touch typingon the virtual keyboard.

SUMMARY

Embodiments of this application provide a feedback method and a relateddevice. When a user touches an anchor point key on a virtual key, afirst feedback operation is performed by using a touchscreen, to promptthe user that the user currently touches the anchor point key, so thatthe user can sense a location of the anchor point key. This reducesdifficulty in implementing touch typing on the touchscreen.

To resolve the foregoing technical problem, embodiments of thisapplication provide the following technical solutions.

According to a first aspect, an embodiment of this application providesa feedback method, which may be used in the field of virtual keyboards.The method is applied to an electronic device. The electronic device isprovided with a touchscreen. The touchscreen is provided with aplurality of vibration feedback elements. The method includes: Theelectronic device detects a first contact operation acting on thetouchscreen, and obtains, in response to the first contact operation,first location information of a first contact point corresponding to thefirst contact operation. The first location information corresponds to afirst virtual key on the virtual keyboard. If the first virtual key isan anchor point key, the electronic device obtains one or more firstvibration feedback elements from the plurality of vibration feedbackelements. The first vibration feedback element is a vibration feedbackelement that matches the first virtual key. Vibration feedback elementsthat match different virtual keys are not completely the same. Thevirtual keyboard may be represented as any type of keyboard. Forexample, the virtual keyboard may be a full-size keyboard, a numerickeyboard, a function keyboard. Alternatively, the virtual keyboard maybe a collective name of all operation keys on the touchscreen. Meaningof the anchor point key is not equivalent to that of a positioning key,that is, the anchor point key means a key used to prompt a user. After acurrently displayed virtual keyboard is determined, a specific virtualkey may be preconfigured as an anchor point key in the electronicdevice, in other words, a specific virtual key may be predetermined asan anchor point key. Alternatively, a specific virtual key may becustomized by the user as an anchor point key, that is, the user maydefine a specific virtual key as an anchor point key in a “setting”interface of the electronic device. Further, for a process ofdetermining, based on the first location information, whether the firstvirtual key is an anchor point key, in an embodiment, the electronicdevice obtains, based on the first location information, the firstvirtual key corresponding to the first contact point, and thendetermines whether the first virtual key is an anchor point key. Inanother embodiment, the electronic device may prestore a specificlocation region on the touchscreen as a location region of the anchorpoint key, and a specific location region on the touchscreen as alocation region of a non-anchor point key. The electronic devicedirectly determines, based on the first location information, whetherthe first contact point is located in the location region of the anchorpoint key, to determine whether the first virtual key corresponding tothe first location information is an anchor point key. The electronicdevice indicates the first vibration feedback elements that match thefirst virtual key to emit a vibration wave, to perform a first feedbackoperation. The first feedback operation is used to prompt that the firstvirtual key is an anchor point key.

In this embodiment, when the user touches an anchor point key in thevirtual key, the user performs a first feedback operation by using thetouchscreen, to prompt the user that the user is currently touching ananchor point key, so that the user can sense a location of the anchorpoint key. This can reduce difficulty in implementing touch typing onthe touchscreen. In addition, the touchscreen is provided with aplurality of vibration feedback elements. If the first virtual key isdetermined as an anchor point key, at least one first vibration feedbackelement that matches the first virtual key is obtained from theplurality of vibration feedback elements. The at least one firstvibration feedback is indicated to emit a vibration wave. This cangenerate vibration feedback effect only around the first virtual key, inother words, vibration feedback is not performed on a full screen. Allfingers are placed on the touchscreen during typing. If the full screenvibrates, all fingers feel vibration. The user is likely to be confused.However, if the vibration feedback effect is generated only around thefirst virtual key, the user is not likely to be confused. It is easierto help the user form a muscle memory at the finger, to assist the userin implementing touch typing on the touchscreen.

In a possible embodiment of the first aspect, after the electronicdevice obtains the first location information of the first contact pointcorresponding to the first contact operation, the method furtherincludes: The electronic device obtains, based on the first locationinformation, the first virtual key corresponding to the first contactpoint. In this embodiment, the first virtual key corresponding to thefirst contact point can be obtained in real time based on the firstlocation information. In this way, this solution is compatible with botha virtual keyboard whose location is fixed and a virtual keyboard whoselocation is movable. This expands an application scenario of thissolution.

In a possible embodiment of the first aspect, a first mappingrelationship is configured for the electronic device. The first mappingrelationship indicates a correspondence between virtual keys andvibration feedback elements. That the electronic device obtains a firstvibration feedback element from the plurality of vibration feedbackelements includes: The electronic device obtains, based on the firstmapping relationship and the first virtual key, a first vibrationfeedback element that matches the first virtual key. Optionally, theelectronic device is preconfigured with a plurality of mappingrelationships that are in a one-to-one correspondence with a pluralityof types of virtual keyboards, and each mapping relationship includes acorrespondence between a plurality of virtual keys and a plurality offirst vibration feedback elements. Then, before obtaining, based on thefirst mapping relationship and the first virtual key, the firstvibration feedback element that matches the first virtual key, theelectronic device needs to first obtain, from the plurality of mappingrelationships, a first mapping relationship that matches a type of acurrently displayed virtual keyboard.

In this embodiment, the first mapping relationship is preconfigured, sothat after the first virtual key is obtained, at least one firstvibration feedback element that matches the first virtual key can beobtained based on the first mapping relationship. This is convenient andhelps improve efficiency of a matching process of the vibration feedbackelement. The operation of determining the vibration feedback element issplit, so that when a fault occurs, a fault location can be preciselylocated.

In a possible embodiment of the first aspect, a first mappingrelationship is configured for the electronic device. The first mappingrelationship indicates a correspondence between the location informationand the vibration feedback element. That the electronic device obtains afirst vibration feedback element from the plurality of vibrationfeedback elements includes: The electronic device obtains, based on thefirst mapping relationship and first location information, a firstvibration feedback element that matches the first location information.Because the first location information corresponds to the first virtualkey on the virtual keyboard, it means obtaining the first vibrationfeedback element corresponding to the first virtual key. In thisembodiment, at least one first vibration feedback element that matchesthe first virtual key can be obtained based on the first locationinformation and the first mapping relationship. This is convenient andhelps improve efficiency of a matching process of the vibration feedbackelement. In addition, the first mapping relationship can indicate acorrespondence between the first location information and one firstvibration feedback element. In this way, this solution is compatiblewith both a virtual keyboard whose location is fixed and a virtualkeyboard whose location is movable. This ensures that vibration feedbackcan be provided in various scenarios.

In a possible embodiment of the first aspect, before the electronicdevice emits the vibration wave by using the first vibration feedbackelement, the method further includes: The electronic device obtains avibration intensity of a vibration wave corresponding to each of atleast one first vibration feedback element. The vibration intensity ofthe vibration wave of each of the at least one first vibration feedbackelement is related to any one or more of the following factors: a firstquantity, a distance between each first vibration feedback unit and acentral point of the first virtual key, a type of the vibration wave,whether the virtual key is an anchor point key, or a location type ofthe first location information. The first quantity is a quantity of thefirst vibration feedback elements. That the electronic device emits avibration wave by using the first vibration feedback element includes:The electronic device emits, based on the vibration intensity of thevibration wave corresponding to each first vibration feedback element,the vibration wave by using the at least one first vibration feedbackelement, so that a difference between a vibration feedback intensitycorresponding to the first virtual key and a vibration feedbackintensity corresponding to a second virtual key falls within a presetintensity range. The second virtual key and the first virtual key aredifferent virtual keys. The preset intensity range may be an intensitydifference within 2%, an intensity difference within 3%, an intensitydifference within 4%, or an intensity difference within 5%. Further, ina process of measuring an intensity on a surface of the touchscreen, aprobe of a vibration measurement instrument may be attached to a surfaceof one virtual key (namely, a detection point) on the touchscreen, tocollect a vibration wave at the detection point and further obtain awaveform curve of the collected vibration wave. The waveform curveindicates a vibration feedback intensity corresponding to the detectionpoint. Further, the difference between the vibration feedback intensitycorresponding to the first virtual key and the vibration feedbackintensity corresponding to the second virtual key may be obtained bycomparing a waveform curve measured at a detection point of the firstvirtual key and a waveform curve measured at a detection point of thesecond virtual key.

In this embodiment, different virtual keys may correspond to differentquantities of vibration feedback elements. Therefore, the intensity ofeach vibration feedback element is determined based on a quantity ofmatched vibration feedback elements, so that a difference betweenvibration feedback intensities of the virtual keys falls within a presetrange. When the user uses a physical key, force feedbacks provided bydifferent keys are basically the same. Therefore, a difference betweenthe virtual keyboard and the physical keyboard can be reduced, and userviscosity is enhanced.

In a possible embodiment of the first aspect, the first vibrationfeedback element is any one type of the following: a piezoelectricceramic sheet, a linear motor, or a piezoelectric film. In thisembodiment, a plurality of specific representation forms of thevibration feedback element are provided, improving implementationflexibility of this solution.

In a possible embodiment of the first aspect, the first contact point isa newly added contact point on the touchscreen. In this embodiment ofthis application, when using a physical keyboard, the user usuallyfocuses on an actual key that is newly touched. This solution generatesfeedback only for a newly added contact point, to better simulate userexperience of inputting by using the physical keyboard. In addition, thefeedback is generated only for the newly added contact point. It iseasier to establish a memory relationship between the user and the newlyadded contact point, further reducing difficulty in touch typingtraining on the touchscreen.

In a possible embodiment of the first aspect, the method furtherincludes: If the first virtual key is a non-anchor point key, theelectronic device performs a second feedback operation. The secondfeedback operation is used to prompt that the first virtual key is anon-anchor point key, and the first feedback operation and the secondfeedback operation are different feedback operations. In thisembodiment, feedback operations are performed in both cases in which thefirst virtual key is an anchor point key or the first virtual key is anon-anchor point key. The first feedback operation and the secondfeedback operation are different feedback operations. When the user usesthe physical keyboard, each key provides feedback for the user. In theforegoing manner, a similarity between the virtual keyboard and thephysical keyboard can be increased. In addition, different feedbackoperations are provided for the anchor point key and the non-anchorpoint key. This can also help the user remember different types of keys,and help the user implement touch typing on the virtual keyboard.

In a possible embodiment of the first aspect, the first feedbackoperation is emitting a first type of vibration wave by using thetouchscreen, and the second feedback operation is emitting a second typeof vibration wave by using the touchscreen. The first type of vibrationwave and the second type of vibration wave are different types ofvibration waves. If the electronic device emits a continuous vibrationwave by using the vibration feedback element, different types ofvibration waves are different in any one or more of the followingcharacteristics: a vibration amplitude, a vibration frequency, vibrationduration, or an envelope shape. If the electronic device emits avibration wave in a pulse form by using the vibration feedback element,different types of vibration waves are different in any one or more ofthe following characteristics: a vibration amplitude, a vibrationfrequency, vibration duration, an envelope shape, or a frequency of avibration wave in a pulse form that is emitted by the electronic device.

In a possible embodiment of the first aspect, before the electronicdevice performs the first feedback operation, the method furtherincludes: The electronic device obtains, based on the first locationinformation, a location type corresponding to the first contact point.The location type includes that the first contact point is located in afirst location region (which may also be referred to as a characteristicregion of an anchor point key) of the first virtual key and that thefirst contact point is located in a second location region (which mayalso be referred to as a side region of the anchor point key) of thefirst virtual key. The first location region is different from thesecond location region. That the electronic device performs a firstfeedback operation includes: The electronic device performs the firstfeedback operation by using the touchscreen based on the location typecorresponding to the first contact point. A feedback operationcorresponding to the first location region is different from a feedbackoperation corresponding to the second location region.

In this embodiment, all location regions of the anchor point key and/orthe non-anchor point key are divided into the first location region andthe second location region. If the first contact point is located in thefirst location region, and if the first contact point is located in thesecond location region, the electronic device emits different types ofvibration waves by using at least one first vibration feedback element.This helps the user remember a boundary of the virtual key, in otherwords, helps the user establish a muscle memory for different regions ofthe virtual key, to further reduce difficulty in implementing touchtyping on the touchscreen.

In a possible embodiment of the first aspect, a feedback operationcorresponding to a first location region of an anchor point key is thesame as a feedback operation corresponding to a first location region ofa non-anchor point key, and a feedback operation corresponding to asecond location region of the anchor point key is different from afeedback operation corresponding to a second location region of thenon-anchor point key. Alternatively, a feedback operation correspondingto a first location region of an anchor point key is different from afeedback operation corresponding to a first location region of anon-anchor point key, and a feedback operation corresponding to a secondlocation region of the anchor point key is the same as a feedbackoperation corresponding to a second location region of the non-anchorpoint key. Alternatively, a feedback operation corresponding to a firstlocation region of an anchor point key is different from a feedbackoperation corresponding to a first location region of a non-anchor pointkey, and a feedback operation corresponding to a second location regionof the anchor point key is different from a feedback operationcorresponding to a second location region of the non-anchor point key.

In a possible embodiment of the first aspect, the first contactoperation is a press operation, and the method further includes: Theelectronic device detects a second contact operation acting on thetouchscreen, and obtains second location information of a second contactpoint corresponding to the second contact operation, where the secondcontact operation is a touch operation. The electronic device changes atactile characteristic of the second contact point on the touchscreen inresponse to the second contact operation. The tactile characteristicincludes any one or more of the following characteristics: a slidingfriction coefficient, a stick slip property, and a temperature.

In a possible embodiment of the first aspect, before the electronicdevice detects the first contact operation acting on the touchscreen,the method further includes: The electronic device detects a firstgesture operation acting on the touchscreen, and selects, in response tothe first gesture operation, a first type of virtual keyboardcorresponding to the first gesture operation from a plurality of typesof virtual keyboards. Virtual keys included in different types ofvirtual keyboards in the plurality of types of virtual keyboards are notcompletely the same. The electronic device displays the first type ofvirtual keyboard by using the touchscreen. A location of the first typeof virtual keyboard on the touchscreen is fixed in the process ofdisplaying the first type of virtual keyboard. That the electronicdevice detects a first contact operation acting on the touchscreenincludes: The electronic device detects the first contact operationacting on the touchscreen in the process of displaying the first type ofvirtual keyboard. Meaning of the nouns, specific embodiment operations,and beneficial effects in this embodiment are described in the followingseventh aspect. Details are not described herein.

According to a second aspect, an embodiment of this application providesan electronic device, which may be used in the field of virtualkeyboards. The electronic device is provided with a touchscreen. Thetouchscreen includes a tactile sensing module and a vibration feedbackmodule. The vibration feedback module includes a plurality of vibrationfeedback elements. The tactile sensing module is configured to obtainfirst location information of a first contact point on the touchscreen.The tactile sensing module may be specifically represented as a tactilesensing film, and the tactile sensing film may be specifically acapacitive tactile sensing film, a pressure tactile sensing film, atemperature tactile sensing film, or another type of film. The firstvibration feedback element is configured to emit a vibration wave if afirst virtual key corresponding to the first contact point is an anchorpoint key. The vibration wave is used to prompt that the first virtualkey is an anchor point key. The first vibration feedback element is anyone type of the following: a piezoelectric ceramic sheet, a linearmotor, or a piezoelectric film. The first virtual key is a virtual keyon a virtual keyboard. The first vibration feedback element is avibration feedback element that matches the first virtual key in theplurality of vibration feedback elements.

In a possible embodiment of the second aspect, the first contact pointis obtained based on a press operation acting on the touchscreen. Thetouchscreen further includes a cover and an ultrasonic module. Theultrasonic module is configured to emit an ultrasonic wave to change atactile characteristic of the cover. Specifically, the tactile sensingmodule is further configured to obtain second location information of asecond contact point on the touchscreen. The ultrasonic module isspecifically configured to emit an ultrasonic wave if the second contactpoint is obtained based on a touch operation acting on the touchscreen,to change the tactile characteristic of the cover. Alternatively, thetouchscreen further includes a cover and an electrostatic module. Theelectrostatic module is configured to generate an electrical signal tochange a tactile characteristic of the cover. Specifically, the tactilesensing module is further configured to obtain second locationinformation of a second contact point on the touchscreen. Theelectrostatic module is specifically configured to generate anelectrical signal if the second contact point is obtained based on atouch operation acting on the touchscreen, to change the tactilecharacteristic of the cover. The tactility characteristic includes anyone or more of the following characteristics: a sliding frictioncoefficient, a stick slip property, and a temperature.

In this embodiment, the touchscreen may further change the tactilecharacteristic of the cover by disposing the ultrasonic module or theelectrostatic module, to provide more abundant tactile feedback. In thisway, the user may implement touch typing training on the touchscreenbased on the more abundant tactile feedback, to further reducedifficulty in implementing touch typing on the touchscreen.

In a possible embodiment of the second aspect, the touchscreen furtherincludes a pressure sensing module. The pressure sensing module and thevibration feedback module are integrated. The vibration feedback elementis a piezoelectric ceramic sheet, a piezoelectric polymer, or apiezoelectric composite. The pressure sensing module is configured tocollect a pressure value corresponding to a first contact operation, todetermine whether the first contact operation is a press operation or atouch operation. Specifically, in one case, a plurality of vibrationfeedback elements included in the vibration feedback module (which mayalso be referred to as the pressure sensing module) may be classified. Asecond vibration feedback element in the plurality of vibration feedbackelements is configured to collect a pressure value. A third vibrationfeedback element in the plurality of vibration feedback elements isconfigured to emit a vibration wave to perform vibration feedback. Thesecond vibration feedback element and the third vibration feedbackelement are different vibration feedback elements. In another case, aplurality of vibration feedback elements in the vibration feedbackmodule (which may also be referred to as the pressure sensing module)are configured to collect the pressure value in a first time period, andare configured to emit a vibration wave in a second time period. Thefirst time period is different from the second time period.

In this embodiment, the touchscreen is further provided with thepressure sensing module for collecting the pressure value. In this way,both the location information and the pressure value of the contactpoint can be obtained, so that further detailed management may beperformed on the contact operation obtained by using the touchscreen. Inaddition, the pressure sensing module and the vibration feedback moduleare integrated. This helps reduce a thickness of the touchscreen,further improving convenience of the electronic device.

For concepts of the nouns, specific embodiment operations and beneficialeffects in the second aspect and some possible embodiments of the secondaspect of embodiments of this application, refer to the descriptions inthe possible embodiments of the first aspect. Details are not describedherein again.

According to a third aspect, an embodiment of this application providesan electronic device, which may be used in the field of virtualkeyboards. The electronic device includes a touchscreen, a memory, oneor more processors, and one or more programs. The touchscreen isprovided with a plurality of vibration feedback elements. The one ormore programs are stored in the memory. When the one or more processorsexecute the one or more programs, the electronic device is enabled toperform the following operations: detecting a first contact operationacting on the touchscreen; obtaining, in response to the first contactoperation, first location information of a first contact pointcorresponding to the first contact operation, where the first locationinformation corresponds to a first virtual key on the virtual keyboard;if the first virtual key is an anchor point key, obtaining a firstvibration feedback element from the plurality of vibration feedbackelements, where the first vibration feedback element is a vibrationfeedback element that matches the first virtual key; and indicating thefirst vibration feedback element to emit a vibration wave, to perform afirst feedback operation, where the first feedback operation is used toprompt that the first virtual key is an anchor point key.

In the third aspect of embodiments of this application, the electronicdevice may further perform the operations performed by the electronicdevice in the possible embodiments of the first aspect. For a specificembodiment of a specific operation in the third aspect and the possibleembodiments of the third aspect of embodiments of this application, anda beneficial effect of each possible embodiment, refer to thedescriptions in the possible embodiments of the first aspect. Detailsare not described herein again.

According to a fourth aspect, an embodiment of this application providesa computer program. When the computer program is run on a computer, thecomputer is enabled to perform the feedback method according to thefirst aspect.

According to a fifth aspect, an embodiment of this application providesan electronic device, including a processor. The processor is coupled toa memory. The memory is configured to store a program. The processor isconfigured to execute the program in the memory, so that an executiondevice is enabled to perform the feedback method according to the firstaspect.

According to a sixth aspect, an embodiment of this application providesa computer-readable storage medium. The computer-readable storage mediumstores a computer program, and when the computer program is run on acomputer, the computer is enabled to perform the feedback methodaccording to the first aspect.

According to a seven aspect, an embodiment of this application providesa chip system. The chip system includes a processor, configured toimplement functions in the first aspect, for example, sending orprocessing of data and/or information in the foregoing method. In apossible design, the chip system further includes a memory. The memoryis configured to store program instructions and data that are necessaryfor a server or a communication device. The chip system may include achip, or may include a chip and another discrete component.

According to an eighth aspect, an embodiment of this applicationprovides a virtual keyboard processing method, which may be applied tothe field of human-computer interaction. The method is applied to anelectronic device, where the electronic device is provided with adisplay. The method includes: The electronic device detects a firstgesture operation acting on the display, and selects, in response to thedetected first gesture operation, a first type of virtual keyboardcorresponding to the first gesture operation from a plurality of typesof virtual keyboards. Virtual keys included in different types ofvirtual keyboards in the plurality of types of virtual keyboards are notcompletely the same. The electronic device displays the first type ofvirtual keyboard by using the display.

In this embodiment, the electronic device is provided with a pluralityof different types of virtual keyboards, and the virtual keys includedin the different types of virtual keyboards are not completely the same.A user can enable different types of virtual keyboards through differentgesture operations. In other words, the virtual keyboard no longerdisplays only 26 letters, but provides more virtual keys for the user byusing the different types of virtual keyboards. This improvesflexibility of a process in which the user enables the virtual keyboard,and helps provide more abundant virtual keys, so that an additionalphysical keyboard does not need to be provided.

In a possible embodiment of the eighth aspect, that the electronicdevice selects a first type of virtual keyboard corresponding to thefirst gesture operation from a plurality of types of virtual keyboardsincludes: The electronic device selects, according to a first rule, thefirst type of virtual keyboard corresponding to the first gestureoperation from the plurality of types of virtual keyboards. The firstrule indicates a correspondence between a plurality of types of gestureoperations and the plurality of types of virtual keyboards. In thisembodiment, the first rule is preconfigured for the electronic device.The first rule indicates the correspondence between the plurality oftypes of gesture operations and the plurality of types of virtualkeyboards. After detecting the first gesture operation acting on thedisplay, the electronic device may obtain, according to the first rule,the first type of virtual keyboard corresponding to the specific firstgesture operation. This can improve efficiency of a matching process ofthe virtual keyboard.

In a possible embodiment of the eighth aspect, in one case, the firstrule directly includes the correspondence between the plurality of typesof gesture operations and the plurality of types of virtual keyboards.The first rule includes a correspondence between a plurality of piecesof first identification information and a plurality of pieces of secondidentification information. The first identification informationuniquely indicates one type of gesture operation, and the secondidentification information uniquely indicates one type of virtualkeyboard. In another case, the first rule includes a correspondencebetween a plurality of groups of conditions and the plurality of typesof virtual keyboards. Each group of conditions in the plurality ofgroups of conditions corresponds to one type of gesture operation. Inother words, each group of conditions in the plurality of groups ofconditions is a restrictive condition of a gesture parametercorresponding to a gesture operation, and each group of conditionscorresponds to one type of gesture operation.

In a possible embodiment of the eighth aspect, before the electronicdevice selects the first type of virtual keyboard corresponding to thefirst gesture operation from the plurality of types of virtualkeyboards, the method further includes: The electronic device obtains afirst gesture parameter corresponding to the first gesture operation.The first gesture parameter includes any one or more of the followingparameters: location information of a contact point corresponding to thefirst gesture operation, quantity information of the contact pointcorresponding to the first gesture operation, area information of thecontact point corresponding to the first gesture operation, relativeangle information of a hand corresponding to the first gestureoperation, location information of the hand corresponding to the firstgesture operation, quantity information of the hand corresponding to thefirst gesture operation, and shape information of the hand correspondingto the first gesture operation. That the electronic device selects afirst type of virtual keyboard corresponding to the first gestureoperation from a plurality of types of virtual keyboards includes: Theelectronic device selects, based on the first gesture parameter, thefirst type of virtual keyboard from the plurality of types of virtualkeyboards.

In this embodiment, the first gesture parameter includes locationinformation of each contact point and quantity information of aplurality of contact points, and also includes area information of eachcontact point. The area information of the contact point can distinguisha contact point triggered based on a palm from the plurality of contactpoints. This helps accurately estimate a type of the first gestureoperation, avoids displaying an incorrect virtual keyboard, and improvesaccuracy of a display process of the virtual keyboard. After secondaryprocessing is performed on the obtained first gesture parameter,information such as relative angle information of the hand, locationinformation of the hand, quantity information of the hand, or shapeinformation of the hand may be obtained. In other words, more abundantinformation about the first gesture operation may be obtained based onthe first gesture parameter, increasing flexibility of a matchingprocess of the virtual keyboard.

In a possible embodiment of the eighth aspect, the method furtherincludes: The electronic device obtains a first angle in response to thefirst gesture operation. The first angle indicates a relative anglebetween the hand corresponding to the first gesture operation and a sideof the display. Alternatively, the first angle indicates a relativeangle between the hand corresponding to the first gesture operation anda center line of the display. That the electronic device displays thefirst type of virtual keyboard by using the display includes: Theelectronic device obtains a first display angle of the first type ofvirtual keyboard based on the first angle, and displays the first typeof virtual keyboard based on the first display angle by using thedisplay. The first display angle indicates a relative angle between aside of the first type of virtual keyboard and the side of the display.Alternatively, the first display angle indicates a relative anglebetween a side of the first type of virtual keyboard and the center lineof the display.

In this embodiment, a relative angle (namely, the first angle) betweenthe hand of the user and a side or a center line of a display interfaceis obtained, and the display angle of the virtual keyboard is determinedbased on the first angle. In this way, the display angle of the keyboardis more suitable for a placement angle of the hand of the user, and itis more comfortable and convenient for the user to input by using thevirtual keyboard.

In a possible embodiment of the eighth aspect, the first type of virtualkeyboard is a full-size keyboard, and the full-size keyboard isclassified into a first sub-keyboard and a second sub-keyboard. Then thefirst angle includes a relative angle of a left hand and a relativeangle of a right hand, the first sub-keyboard and the secondsub-keyboard include different virtual keys on the full-size keyboard,and the first display angle includes a display angle of the firstsub-keyboard and a display angle of the second sub-keyboard. If thefirst angle indicates the relative angle between the hand correspondingto the first gesture operation and the side of the display, the displayangle of the first sub-keyboard indicates a relative angle between aside of the first sub-keyboard and the side of the display, and thedisplay angle of the second sub-keyboard indicates a relative anglebetween a side of the second sub-keyboard and the side of the display.If the first angle indicates the relative angle between the hand in thefirst gesture corresponding to the first gesture operation and thecenter line of the display, the display angle of the first sub-keyboardindicates a relative angle between a side of the first sub-keyboard andthe center line of the display, and the display angle of the secondsub-keyboard indicates a relative angle between a side of the secondsub-keyboard and the center line of the display.

In a possible embodiment of the eighth aspect, in one case, theelectronic device determines whether the first angle is greater than orequal to a preset angle threshold. If the first angle is greater than orequal to the preset angle threshold, the electronic device obtains thefirst display angle, and displays the first type of virtual keyboard atthe first display angle by using the display. A value of the presetangle threshold may be 25 degrees, 28 degrees, 30 degrees, 32 degrees,35 degrees, another value, or the like. This is not limited herein. Inanother case, after obtaining the first angle, the electronic devicedetermines the first display angle of the first type of virtual keyboardas the first angle, and displays the first type of virtual keyboardbased on the first angle by using the display.

According to a possible embodiment of the eighth aspect, the differenttypes of virtual keyboards in the plurality of types of virtualkeyboards have different functions. The virtual keyboards with differentfunctions include a combination of any two or more types of thefollowing virtual keyboards: a numeric keyboard, a function keykeyboard, a full-size keyboard, and a custom keyboard. The function keykeyboard is formed by function keys. In this embodiment, the differenttypes of virtual keyboards have the different functions, so that thevirtual keyboards with the different functions may be provided for theuser. This improves flexibility of a process in which the user uses thevirtual keyboard, to enhance user viscosity.

In a possible embodiment of the eighth aspect, if the first gestureoperation is a one-hand operation, the first type of virtual keyboard isany one type of the following virtual keyboards: a mini keyboard, anumeric keyboard, a function keyboard, a function key keyboard, a roundkeyboard, an arc keyboard, and a custom keyboard. The mini keyboardincludes 26 alphabet keys. The function keyboard is displayed in anapplication. A virtual key included on the function keyboard correspondsto a function of the application. It should be noted that a minikeyboard, a numeric keyboard, a function keyboard, a function keykeyboard, a round keyboard, an arc keyboard, and a custom keyboard donot need to be all configured in a same electronic device. The exampleherein is only used to prove that a one-hand operation in one electronicdevice may trigger any one type of the mini keyboard, the numerickeyboard, the function keyboard, the function key keyboard, the roundkeyboard, the arc keyboard, or the custom keyboard. In this embodiment,a plurality of specific representation forms of the virtual keyboarddisplayed by using the display are provided in both cases in which thefirst gesture operation is the one-hand operation or a two-handoperation. This improves embodiment flexibility of this solution andexpands an application scenario of this solution.

In a possible embodiment of the eighth aspect, if the first gestureoperation is a two-hand operation, the first type of virtual keyboard isa full-size keyboard. The full-size keyboard includes at least 26alphabet keys, and a size of the full-size keyboard is larger than thatof a mini keyboard. That the electronic device displays the first typeof virtual keyboard by using the display includes: If a distance betweentwo hands is less than or equal to a first distance threshold, theelectronic device displays the full-size keyboard in an integratedmanner by using the display; or if a distance between two hands isgreater than a first distance threshold, the electronic device displaysa first sub-keyboard by using a second region on the display, anddisplays a second sub-keyboard by using a third region on the display.The second region and the third region are different regions on thedisplay. The first sub-keyboard and the second sub-keyboard includedifferent virtual keys on the full-size keyboard. A value of the firstdistance threshold may be 70 millimeters, 75 millimeters, 80millimeters, or the like. This is not limited herein.

In this embodiment, whether to display the virtual keyboard in anintegrated manner or in a separated manner may be determined based onthe distance between the two hands of the user. This further improvesflexibility of a process of displaying the virtual keyboard, facilitatesthe user to use the displayed virtual keyboard, and further enhancesuser viscosity of this solution.

In a possible embodiment of the eighth aspect, if the first gestureoperation is a first one-hand operation, the first type of virtualkeyboard is a mini keyboard. In this embodiment, if the first gestureoperation is the one-hand operation, the first type of virtual keyboardis the mini keyboard. This helps improve flexibility of a process ofinputting a letter by the user.

In a possible embodiment of the eighth aspect, the one-hand operationincludes a left-hand operation and a right-hand operation. If the firstgesture operation is the right-hand operation, the first type of virtualkeyboard is a numeric keyboard. If the first gesture operation is theleft-hand operation, the first type of virtual keyboard is a functionkeyboard. A virtual key included on the function keyboard corresponds toa function of the application. For example, if the first gestureoperation is obtained from a game application, the function keyboard maybe a game keyboard, and the game keyboard is provided with keys commonlyused for a game. For another example, if the first gesture operation isobtained from a drawing application, the function keyboard may be acommon key in drawing software, and the like.

In this embodiment, if the first gesture operation is the right-handoperation, the first type of virtual keyboard is the numeric keyboard;or if the first gesture operation is the left-hand operation, the firsttype of virtual keyboard is the function keyboard. This better satisfiesa habit of using a physical keyboard by the user, to reduce a differencebetween the virtual keyboard and the physical keyboard and enhance userviscosity.

In a possible embodiment of the eighth aspect, if the first gestureoperation is a one-hand operation in a first region on the display, thefirst type of virtual keyboard is a function key keyboard, and the firstregion is located in a lower left corner or a lower right corner of thedisplay. In this embodiment, the function key is configured in the lowerleft corner or the lower right corner of the physical keyboard. If thefirst gesture operation is the one-hand operation in the first region onthe display, the first type of virtual keyboard is a function keykeyboard. Because a triggering gesture is the same as a habit of using aphysical keyboard by the user, it is convenient for the user to rememberthe triggering gesture. This reduces implementation difficulty of thissolution, and enhances user viscosity.

In a possible embodiment of the eighth aspect, the method furtherincludes: The electronic device obtains a contact operation on a firstvirtual key on a function key keyboard. For example, the first virtualkey may be a Ctrl key, or may include both a Ctrl key and a Shift key.The electronic device highlights a second virtual key on the display inresponse to the contact operation on the first virtual key on thefunction key keyboard. The second virtual key is a key other than thefirst virtual key in a shortcut key combination. Highlighting includesbut is not limited to highlight display, bold display, or flash display.This is not limited herein. For example, in a drawing application, a keycombination of a Ctrl key, a Shift key, and an I key can provide afunction of color inversion of a currently processed image. In thiscase, the first virtual key includes the Ctrl key and the Shift key, andthe second virtual key is the virtual I key.

In this embodiment of this application, in the process of displaying thefunction key keyboard on the display, the electronic device obtains thecontact operation on the first virtual key on the function key keyboardand highlights the second virtual key on the display in response to thecontact operation. The second virtual key is the key other than thefirst virtual key in the shortcut key combination. Because the functionkey keyboard occupies a small area, an area required for displaying thevirtual keyboard is reduced. When the user performs the contactoperation on the first virtual key on the function key keyboard, thesecond virtual key in the shortcut key combination can be automaticallydisplayed. This ensures a requirement of the user for the shortcut keysand avoids waste of a display area on the display.

In a possible embodiment of the eighth aspect, if the first gestureoperation is a contact operation obtained by using the display, thefirst gesture parameter includes quantity information of a contact pointcorresponding to the first gesture operation. If the first gestureoperation is a one-hand operation with less than three contact points,the first type of virtual keyboard is a round keyboard or an arckeyboard. In this embodiment, when the first gesture operation is theone-hand operation with less than three contact points, the roundkeyboard or the arc keyboard may be further provided. In this way, botha keyboard existing in a physical keyboard and a keyboard that does notexist in the physical keyboard can be provided. This enriches keyboardtypes, provides more choices for the user, and further enhancesselection flexibility of the user.

In a possible embodiment of the eighth aspect, the first rule includes afirst sub-rule. The first sub-rule is obtained by performing a customoperation on at least one type of gesture operation and/or at least onetype of virtual keyboard. In this embodiment, the user may customize atype of a triggering gesture and/or a virtual keyboard, so that adisplay process of the virtual keyboard better meets expectation of theuser, and user viscosity of this solution is further increased.

In a possible embodiment of the eighth aspect, the display is providedwith a plurality of vibration feedback elements. A location of the firsttype of virtual keyboard on the display is fixed in the process ofdisplaying the first type of virtual keyboard. After the first type ofvirtual keyboard is displayed by using the display, the method furtherincludes: The electronic device detects a first contact operation actingon the display, and obtains, in response to the first contact operation,first location information of a first contact point corresponding to thefirst contact operation. The first location information corresponds to afirst virtual key on the virtual keyboard. If the first virtual key isan anchor point key, the electronic device obtains a first vibrationfeedback element from the plurality of vibration feedback elements. Thefirst vibration feedback element is a vibration feedback element thatmatches the first virtual key. The electronic device indicates the firstvibration feedback elements that match the first virtual key to emit avibration wave, to perform a first feedback operation. The firstfeedback operation is used to prompt that the first virtual key is ananchor point key. For meaning of the nouns such as the first contactoperation, the first contact point, the first location information, thefirst virtual key, and the first vibration feedback element in thisembodiment, specific embodiment operations, and beneficial effects,refer to the descriptions in the possible embodiments of the firstaspect. Details are not described herein again.

In the eighth aspect of embodiments of this application, the electronicdevice may further perform the operations performed by the electronicdevice in the possible embodiments of the first aspect. For a specificembodiment of a specific operation in the eighth aspect and the possibleembodiments of the eighth aspect of embodiments of this application, anda beneficial effect of each possible embodiment, refer to thedescriptions in the possible embodiments of the first aspect. Detailsare not described herein again.

According to a ninth aspect, an embodiment of this application providesan electronic device, which may be used in the field of human-computerinteraction. The electronic device includes a display, a memory, one ormore processors, and one or more programs. The one or more programs arestored in the memory, and when the one or more processors execute theone or more programs, the electronic device is enabled to perform thefollowing operations: selecting, in response to a detected first gestureoperation, a first type of virtual keyboard corresponding to the firstgesture operation from a plurality of types of virtual keyboards, wherevirtual keys included in different types of virtual keyboards in theplurality of types of virtual keyboards are not completely the same; anddisplaying the first type of virtual keyboard by using the display.

In the ninth aspect of embodiments of this application, the electronicdevice may further perform the operations performed by the electronicdevice in the possible embodiments of the eighth aspect. For a specificembodiment of a specific operation in the ninth aspect and the possibleembodiments of the ninth aspect of embodiments of this application, anda beneficial effect of each possible embodiment, refer to thedescriptions in the possible embodiments of the eighth aspect. Detailsare not described herein again.

According to a tenth aspect, an embodiment of this application providesa computer program. When the computer program is run on a computer, thecomputer is enabled to perform the virtual keyboard processing methodaccording to the eighth aspect.

According to an eleventh aspect, an embodiment of this applicationprovides an electronic device, including a processor. The processor iscoupled to a memory. The memory is configured to store a program. Theprocessor is configured to execute the program in the memory, so thatthe electronic device is enabled to perform the virtual keyboardprocessing method according to the eighth aspect.

According to a twelfth aspect, an embodiment of this applicationprovides a computer-readable storage medium. The computer-readablestorage medium stores a computer program, and when the computer programis run on a computer, the computer is enabled to perform the virtualkeyboard processing method according to the eighth aspect.

According to a thirteenth aspect, an embodiment of this applicationprovides a chip system. The chip system includes a processor, configuredto implement functions in the foregoing aspects, for example, sending orprocessing of data and/or information in the foregoing methods. In apossible design, the chip system further includes a memory. The memoryis configured to store program instructions and data that are necessaryfor a server or a communication device. The chip system may include achip, or may include a chip and another discrete component.

According to a fourteenth aspect, an embodiment of this applicationprovides an application interface processing method, which may beapplied to the field of human-computer interaction. The method isapplied to an electronic device, and the electronic device includes afirst display and a second display. The method includes: The electronicdevice displays a first application interface by using the firstdisplay. The electronic device changes a mode type corresponding to thefirst application interface to handwriting input in response to adetected first operation. The electronic device triggers, in response tothe handwriting input mode, display of the first application interfaceon the second display, to obtain handwriting content for the firstapplication interface by using the second display. Specifically, anoperating system runs on the electronic device. The electronic devicemay display the first application interface on the second display byinvoking a move to function in the operating system, or by invoking aSet Window Position function in the operating system, or by invoking aSet Window Placement function in the operating system.

In this embodiment, the electronic device displays the first applicationinterface on the first display. If the electronic device detects thatthe mode type corresponding to the first application interface ishandwriting input, the electronic device triggers display of the firstapplication interface on the second display, to directly perform inputby using the first application interface displayed on the seconddisplay. According to the foregoing manner, if a user places the seconddisplay in a direction convenient for writing, the user does not need toperform any operation, and the electronic device can automaticallydisplay, on the second display convenient for writing, an applicationinterface for writing input. This improves efficiency of an entire inputprocess, avoids redundant operations, simplifies the operation, andhelps enhance user viscosity.

In a possible embodiment of the fourteenth aspect, after the electronicdevice triggers display of the first application interface on the seconddisplay in response to the handwriting input mode, the method furtherincludes: If the electronic device detects that the mode typecorresponding to the first application interface is changed to keyboardinput, the electronic device triggers, in response to the keyboard inputmode, display of the first application interface on the first displayand display of a virtual keyboard on the second display, to obtain inputcontent for the first application interface by using the virtualkeyboard on the second display. Alternatively, if the electronic devicedetects that the mode type corresponding to the first applicationinterface is changed to keyboard input, the electronic device triggers,in response to the keyboard input mode, display of the first applicationinterface on the first display, and display of a virtual keyboard and anapplication control bar on the second display.

In this embodiment, in the process of displaying the applicationinterface, when the application interface is changed from another modetype to handwriting input, a layout of the application interface ondifferent displays of the electronic device can be automaticallyadjusted. When the mode type of the application interface is changed tokeyboard input, the layout of the application interface on differentdisplays of the electronic device can also be automatically adjusted,and the virtual keyboard can be automatically displayed. In this way,when the mode type of the application interface is changed to keyboardinput, the user does not need to manually adjust the layout of theapplication interface on different displays, but can directly performkeyboard input. The operations are simple, and user viscosity in thissolution is further increased.

In a possible embodiment of the fourteenth aspect, the method mayfurther include: The electronic device detects a second operation actingon the second display; and in response to the second operation, changesa first display area of the application control bar to a second displayarea, and changes a first control key group included in the applicationcontrol bar to a second control key group. Both the first control keygroup and the second control key group are control key setscorresponding to a target application. Specific meaning of the nouns inthe foregoing operations and the specific embodiments of the foregoingoperations are described in the following twentieth aspect. Details arenot described herein again.

In a possible embodiment of the fourteenth aspect, the first applicationinterface includes a first control key. The method may further include:The electronic device detects a second operation on the first targetapplication interface; and in response to the second operation, displaysthe first control key in the application control bar, and hides thefirst control key in the first application interface. Specific meaningof the nouns in the foregoing operations and the specific embodiments ofthe foregoing operations are described in the following twenty-firstaspect. Details are not described herein again.

In a possible embodiment of the fourteenth aspect, the displaying avirtual keyboard on the second display includes: displaying a secondtype of virtual keyboard on the second display. The method furtherincludes: The electronic device detects a first gesture operation actingon the second display, and selects, in response to the detected firstgesture operation, a first type of virtual keyboard corresponding to thefirst gesture operation from a plurality of types of virtual keyboards.Virtual keys included in different types of virtual keyboards in theplurality of types of virtual keyboards are not completely the same. Theelectronic device displays the first type of virtual keyboard by usingthe second display. The first type of virtual keyboard and the secondtype of virtual keyboard are different types of virtual keyboards in theplurality of types of virtual keyboards. For specific meaning of thenouns in the foregoing operations and the specific embodiments of theforegoing operations, refer to the descriptions of the eighth aspect. Inthe fourteenth aspect of embodiments of this application, the electronicdevice may further perform the operations performed by the electronicdevice in the possible embodiments of the eighth aspect. For a specificembodiment of a specific operation in the fourteenth aspect and thepossible embodiments of the fourteenth aspect of embodiments of thisapplication, and a beneficial effect of each possible embodiment, referto the descriptions in the possible embodiments of the eighth aspect.Details are not described herein again.

In a possible embodiment of the fourteenth aspect, after the electronicdevice triggers display of the first application interface on the seconddisplay in response to the handwriting input mode, the method furtherincludes: If the electronic device detects that the mode typecorresponding to the first application interface is changed to abrowsing mode, the electronic device triggers, in response to thebrowsing mode, display of the first application interface on the firstdisplay and stops displaying the first application interface on thesecond display. In this embodiment, when the mode type of theapplication interface is changed to the browsing mode, a layout of theapplication interface on different displays can also be automaticallyadjusted. Therefore, when the mode type of the application interface ischanged to the browsing mode, the user does not need to manually adjustthe layout of the application interface on different displays, in otherwords, in a plurality of different application scenarios, operations canbe simplified, and user viscosity of this solution is further increased.

In a possible embodiment of the fourteenth aspect, the electronic devicedetects that the first operation includes any one or a combination ofthe following five items: If the electronic device detects that aholding posture of an electronic pen meets a first preset condition, theelectronic device determines that the first operation is detected, wherethe holding posture includes any one or a combination of the following:a holding location, holding force, and a holding angle, and the firstpreset condition includes any one or a combination of the following: theholding location falls within a first location range, the holding forcefalls within a first force range, and the holding angle falls within afirst angle range. Alternatively, the electronic device obtains atrigger instruction for handwriting input by using a first icon, wherethe first icon is displayed on the first application interface; if theelectronic device detects a preset tapping operation or a preset trackoperation, the electronic device determines that the first operation isdetected, where the preset tapping operation may be a tap operation, adouble-tap operation, a triple-tap operation, or a touch and holdoperation, and the preset track operation may be a “Z”-shaped trackoperation, a slide down operation, a “tick”-shaped track operation, or a“circle”-shaped track operation; if the electronic device detects thatan electronic pen is located in a preset range of the second display,the electronic device determines that the first operation is detected;or if the electronic device detects that an electronic pen changes froma first preset state to a second preset state, the electronic devicedetermines that the first operation is detected. That an electronic penchanges from a first preset state to a second preset state may be thatthe electronic pen changes from a static state to a moving state, or theelectronic pen changes from an unheld state to a held state.

In this embodiment, a plurality of determining manners of the mode typecorresponding to the first application interface are provided. Thisimproves implementation flexibility of this solution and expands anapplication scenario of this solution. Further, the mode typecorresponding to the first application interface is determined based onthe holding posture of the electronic pen, so that the user can changethe mode type of the first application interface without performinganother operation. In addition, the mode type corresponding to the firstapplication interface is determined based on the posture of holding theelectronic pen by the user. This can reduce an error rate in a processof determining the mode type corresponding to the first applicationinterface, reduce a probability of incorrectly placing the firstapplication interface, avoid waste of computer resources, and helpenhance user viscosity.

In a possible embodiment of the fourteenth aspect, the first operationis a slide operation in a first direction obtained by using the seconddisplay. The slide operation in the first direction is a slide operationof sliding from an upper side of the second display to a lower side ofthe second display. A distance between the upper side of the seconddisplay and the first display is shorter than a distance between thelower side of the second display and the first display. Specifically,the electronic device obtains the slide operation in the first directionby using the second display, and in response to the slide operation inthe first direction, the virtual keyboard displayed on the seconddisplay is moved in the first direction toward the lower side of thesecond display. When an upper side of the virtual keyboard reaches thelower side of the second display, the electronic device determines thatthe mode type corresponding to the first application interface ischanged to handwriting input. In this embodiment, the virtual keyboarddisplayed on the second display can accompany a slide down operation ofthe user. When the upper side of the virtual keyboard reaches the lowerside of the second display, the electronic device determines that themode type corresponding to the first application interface is changed tohandwriting input. This increases interest in a process of changing fromkeyboard input to handwriting input, and helps enhance user viscosity.

In a possible embodiment of the fourteenth aspect, after the electronicdevice triggers display of the first application interface on the seconddisplay, the method further includes: The electronic device obtains astart operation for the second application interface, and determines,based on the start operation, a mode type corresponding to the secondapplication interface. The second application interface and the firstapplication interface are different application interfaces. If the modetype corresponding to the second application interface is handwritinginput, the electronic device triggers, in response to the handwritinginput mode, display of the second application interface on the seconddisplay. Alternatively, if the mode type corresponding to the secondapplication interface is keyboard input, the electronic device triggers,in response to the keyboard input mode, display of the secondapplication interface on the first display, and display of the virtualkeyboard on the second display. Alternatively, if the mode typecorresponding to the second application interface is a browsing mode,the electronic device triggers, in response to the browsing mode,display of the second application interface on the first display.

In this embodiment, in a process of using the application interface bythe user, the mode type corresponding to the application interface canbe automatically detected, to adjust a display location of theapplication interface based on the mode type corresponding to theapplication interface. In addition, when the application interface isopened, the mode type corresponding to the application interface may bedetermined based on the start operation, to determine the displaylocation of the application interface, so that the user can directly usethe application interface after performing the start operation, withoutperforming a location movement operation on the application interface.This further improves convenience of this solution, and enhances userviscosity of this solution.

In a possible embodiment of the fourteenth aspect, that the electronicdevice determines, based on the start operation, a mode typecorresponding to the second application interface includes: If the startoperation is obtained by using the first display, the electronic devicedetermines that the mode type corresponding to the second applicationinterface is keyboard input or a browsing mode. Alternatively, if thestart operation is obtained by using the second display, the electronicdevice determines that the mode type corresponding to the secondapplication interface is handwriting input.

In a possible embodiment of the fourteenth aspect, that the electronicdevice determines, based on the start operation, a mode typecorresponding to the second application interface includes: If the startoperation is obtained by using an electronic pen, the electronic devicedetermines that the mode type corresponding to the second applicationinterface is handwriting input. Alternatively, if the start operation isobtained by using a mouse or a finger, the electronic device determinesthat the mode type corresponding to the second application interface iskeyboard input or a browsing mode.

According to a fifteenth aspect, an embodiment of this applicationprovides an electronic device, which may be used in the field ofhuman-computer interaction. The electronic device includes a firstdisplay, a second display, a memory, one or more processors, and one ormore programs. The one or more programs are stored in the memory. Whenthe one or more processors execute the one or more programs, theelectronic device is enabled to perform the following operations:displaying a first application interface by using the first display;changing a mode type corresponding to the first application interface tohandwriting input in response to a detected first operation; andtriggering, in response to the handwriting input mode, display of thefirst application interface on the second display, to obtain handwritingcontent for the first application interface by using the second display.For concepts of the nouns and specific embodiment operations in thesecond aspect and some possible embodiments of the second aspect ofembodiments of this application, and a beneficial effect of eachpossible embodiment, refer to the descriptions in the possibleembodiments of the first aspect. Details are not described herein again.

In the fifteenth aspect of embodiments of this application, theelectronic device may further perform the operations performed by theelectronic device in the possible embodiments of the fourteenth aspect.For a specific embodiment of a specific operation in the fifteenthaspect and the possible embodiments of the fifteenth aspect ofembodiments of this application, and a beneficial effect of eachpossible embodiment, refer to the descriptions in the possibleembodiments of the fourteenth aspect. Details are not described hereinagain.

According to a sixteenth aspect, an embodiment of this applicationprovides a computer program. When the computer program is run on acomputer, the computer is enabled to perform the application interfaceprocessing method according to the fourteenth aspect.

According to a seventeenth aspect, an embodiment of this applicationprovides an electronic device, including a processor. The processor iscoupled to a memory. The memory is configured to store a program. Theprocessor is configured to execute the program in the memory, so thatthe electronic device is enabled to perform the application interfaceprocessing method according to the fourteenth aspect.

According to an eighteenth aspect, an embodiment of this applicationprovides a computer-readable storage medium. The computer-readablestorage medium stores a computer program, and when the computer programis run on a computer, the computer is enabled to perform the applicationinterface processing method according to the fourteenth aspect.

According to a nineteenth aspect, an embodiment of this applicationprovides a chip system. The chip system includes a processor, configuredto implement functions in the foregoing aspects, for example, sending orprocessing of data and/or information in the foregoing methods. In apossible design, the chip system further includes a memory. The memoryis configured to store program instructions and data that are necessaryfor a server or a communication device. The chip system may include achip, or may include a chip and another discrete component.

According to a twentieth aspect, an embodiment of the present inventionprovides a screen display method, applied to an electronic deviceincluding a first display and a second display. The screen displaymethod includes:

-   -   displaying a target application interface on the first display;    -   displaying an application control bar on the second display; and    -   changing a first display area of the application control bar to        a second display area in response to a received first operation.

When a display area of the application control bar is the first displayarea, the application control bar includes a first control key group.

When a display area of the application control bar is the second displayarea, the application control bar includes a second control key group.

Both the first control key group and the second control key group arecontrol key sets for controlling the target application, and controlkeys included in the first control key group and the second control keygroup are not completely the same.

The electronic device may be an electronic device having two displaysconnected together (for example, connected through a shaft). The twodisplays may be two independent displays, or may be two displays dividedfrom a flexible folding screen or a curved screen, and may be used toperform different functions. The electronic device may be an electronicdevice that works independently as a whole, for example, a personalnotebook computer, or may be an electronic device formed by connectingtwo electronic devices that can work independently and work together,for example, a dual-screen electronic device formed by splicing twomobile phones or two tablet computers.

The first operation may be an operation directly acting on theapplication control bar. For example, the first operation may bechanging the display area of the application control bar through atouchscreen gesture. Alternatively, the first operation may be changingthe display area of the application control bar by tapping or clicking(finger tapping, mouse clicking, or the like) a zoom-in or zoom-out keyof the application control bar. Alternatively, the first operation maybe changing the display area of the application control bar by dragginga boundary of the application control bar by using a mouse. The firstoperation may alternatively be an operation indirectly performed on theapplication control bar. For example, the first operation may directlyact on a control region in the foregoing three manners, to change thedisplay area of the application control bar by changing a display areaof the control region. Alternatively, the first operation may directlyact on another application display interface or an input module (such asa virtual keyboard or a handwriting input region) in the second displayin the foregoing three manners, to change the display area of theapplication control bar by changing a display area of another displaymodule in the second display. Alternatively, the first operation may bean operation performed by a user on the target application in the firstdisplay. For example, when a quantity of control keys displayed in theapplication control bar corresponding to the first user operation isdifferent from a quantity of control keys displayed in the applicationcontrol bar before the first operation, the display area of theapplication control bar may be adaptively adjusted, so that the controlkey corresponding to the first operation can be better displayed.

The display area and the control key of the application control bar areflexibly changed based on an operation and/or a requirement of the user,so that the application control bar may be flexibly adjusted based onthe operation or the requirement of the user, and a control key relatedto a current user operation is always displayed in the applicationcontrol bar. This provides a more convenient input operation for theuser and improves user experience.

With reference to the twentieth aspect, in a first possible embodimentof the twentieth aspect:

-   -   before the first display area of the application control bar is        changed to the second display area, the virtual keyboard is        displayed on the second display; and    -   after the first display area of the application control bar is        changed to the second display area, a display layout of the        virtual keyboard is changed.

Specifically, when the second display area is greater than the firstdisplay area, a display area of the virtual keyboard correspondinglydecreases, and a layout of keys on the virtual keyboard also changeswith the change of the display area. For example, all or some keys maybe zoomed out, or some keys may be omitted, or a spacing between keysmay be reduced. When the second display area is smaller than the firstdisplay area, a display area of the virtual keyboard correspondinglyincreases, and a layout of keys on the virtual keyboard also changeswith the change of the display area. For example, all or some keys maybe zoomed in, or some keys may be added, or a spacing between keys maybe increased, or another functional module such as a touchpad may beadded to the virtual keyboard.

The application control bar is usually displayed on the second displaytogether with another display module (an application module, an inputmodule, or the like) on the second display. Therefore, when the displayarea of the application control bar changes, a display layout of theanother display module is adaptively adjusted. In this way, nothing ismissing or folded on the second display. This optimizes a display layouton the second display and improves user experience.

With reference to the twentieth aspect or the first possible embodimentof the twentieth aspect, in a second possible embodiment of thetwentieth aspect:

-   -   before the first display area of the application control bar is        changed to the second display area, a target application        interface includes a third control key group;    -   the second display area is greater than the first display area;    -   the second control key group includes the first control key        group and the third control key group; and    -   after the first display area of the application control bar is        changed to the second display area, a target application        interface includes the third control key group.

When the user needs to display more control keys in the applicationcontrol bar, or a quantity of control keys corresponding to a currentuser operation is large, a display area of the application controlregion is increased, and control keys displayed in the applicationcontrol region are increased. This can provide more control keys for theuser, and provide a more convenient input mode for the user. Inaddition, when the display area of the application control bar isincreased, a control key on the first display is moved to theapplication control bar on the second display for displaying. This cansave display space of the first display, and display content on thefirst display becomes more concise and clearer. In addition, after thecontrol key displayed in the application control bar is not displayed onthe first display, a size of original display content on the firstdisplay may be increased, or new display content may be added based onthe original display content. This provides a more convenient operationfor the user and improves user experience.

With reference to the second possible embodiment of the twentiethaspect, in a third possible embodiment of the twentieth aspect:

-   -   the third control key group is determined based on the second        display area and a priority sequence of to-be-displayed control        keys in a to-be-displayed control key set of the target        application.

Specifically, the to-be-displayed control key set of the targetapplication may be a to-be-displayed control key set that may bedisplayed in the application control bar and that is provided by anapplication. The priority sequence of the to-be-displayed control keysin the set may be specified by the application, or may be determined byan operating system based on a factor such as a function of theto-be-displayed control key or a use frequency of the user.

For the to-be-displayed control key set provided by the application, theapplication or the operating system may specify the priority sequence ofthe to-be-displayed control keys, the operating system may determine acontrol key to be added to the application control bar when the displayarea of the application control bar is increased, and determine acontrol key to be displayed in the application control bar in variousdisplay areas of the application control bar. This allows more flexiblesetting of the application control bar, and can support variousoperation manners and requirements of the user.

When the display area of the application control bar is increased, adisplay key to be added to the application control region is determinedbased on the priority sequence of the to-be-displayed control keys. Inthis way, if the display area of the application control bar is limited,a control key with a higher priority (higher importance, or a higher usefrequency of the user) can be preferentially displayed in theapplication control bar. This can provide a more convenient operationfor the user and improve user experience.

With reference to the second possible embodiment of the twentieth aspector the third possible embodiment of the twentieth aspect, in a fourthpossible embodiment of the twentieth aspect:

-   -   the third control key group is displayed at a location closer to        the first display than the first control key group.

In the foregoing setting, the first control key group is displayed at alocation closer to two hands of the user than the third control keygroup. In other words, each time the application control bar isexpanded, a newly added control key is always displayed at the locationclose to the first display, and a control key originally displayed inthe application control bar is displayed at the location closer to thetwo hands of the user, to facilitate a user operation. In a process ofexpanding the display area of the application control bar, a priority ofthe newly added control key is usually lower than that of the controlkey originally displayed in the application control bar. Therefore, acontrol key with a higher priority may be always displayed at a locationcloser to the two hands of the user, to provide a more convenientoperation for the user and improve user experience.

With reference to the twentieth aspect or the first possible embodimentof the twentieth aspect, in a fifth possible embodiment of the twentiethaspect:

-   -   before the first display area of the application control bar is        changed to the second display area, a target application        interface does not include a fourth control key group, where the        fourth control key group is a control key set for controlling        the target application;    -   the second display area is less than the first display area;    -   the second control key group is the first control key group        minus the fourth control key group; and    -   after the first display area of the application control bar is        changed to the second display area, the target application        interface includes some or all of the fourth control key group.

When the user wants to display a small quantity of control keys in theapplication control bar, or a quantity of control keys corresponding toa current user operation is small, or the user needs to enlarge adisplay area of another display module on the second display, thedisplay area of the application control region is reduced, and controlkeys displayed in the application control region are decreased. This candecrease display controls on the second display, reduce visualinterference with the user, and facilitate the user to quickly locate arequired control key. In addition, after the fourth control key group isremoved from the application control bar, some or all of control keygroups in the fourth control key group are displayed on the firstdisplay. In this way, when the user needs to use these control keys, theuser can still perform an operation on the first display. Thiscompensates for impact on a user operation in the case of zooming outthe application control bar, and improves user experience.

With reference to the fifth possible embodiment of the twentieth aspect,in a sixth possible embodiment of the twentieth aspect:

-   -   the fourth control key group is determined based on the second        display area and a priority sequence of the control keys in the        first control key group or a location relationship of the        control keys in the first control key group.

The priority sequence of the control keys in the first control key groupmay be specified by an application, or may be specified by a system. Aspecific control key to be removed from the application control bar maybe determined based on the priority sequence of the control keys whenthe display area of the application control bar is reduced. In this way,a control key with a high priority can be reserved in the applicationcontrol bar, to improve operation experience of the user. The userperforms an operation of reducing the display area of the applicationcontrol bar, to hide display of a specific region of the applicationcontrol bar. For example, the user hides a part of display contentthrough a drag operation, a specific control key to be hidden may bedetermined based on a location of the control key, to achieve anoperation objective of the user.

With reference to any one of the twentieth aspect, or the first twopossible embodiments of the twentieth aspect, or the fifth possibleembodiment of the twentieth aspect, in a seventh possible embodiment ofthe twentieth aspect:

-   -   the second control key group is a control key group        corresponding to the second display area of the application        control bar.

The control key group corresponding to the second display area of theapplication control bar may be provided by an application. For example,the application may define corresponding control key groups for displayareas of several fixed sizes of the application control bar. When thedisplay area of the application control bar corresponds to a displayarea of a fixed size, a control key group corresponding to the displayarea is displayed in the application control bar. Alternatively, theapplication may further define corresponding control key groupsseparately for several size change ranges of the display area of theapplication control bar. When an actual display area of the applicationcontrol bar falls within a specific size range, a control key groupcorresponding to the size range is displayed in the application controlbar.

The control key displayed in the application control bar is determinedin the foregoing manner. This can greatly reduce a calculation amount ofan operating system, greatly shorten reaction time for performing thefirst operation by the operating system, and improve operationefficiency.

With reference to any one of the twentieth aspect, or the foregoingseven possible embodiments of the twentieth aspect, in an eighthpossible embodiment of the twentieth aspect:

-   -   the first operation is a gesture operation;    -   in response to the received first operation, the first display        area of the application control bar is changed to the second        display area which specifically includes:    -   in response to a gesture operation, a first type of virtual        keyboard corresponding to the gesture operation is selected from        a plurality of types of virtual keyboards, where virtual keys        included in different types of virtual keyboards in the        plurality of types of virtual keyboards are not completely the        same;    -   a first type of virtual keyboard is displayed by using the        second display; and    -   the second display area is determined based on a display region        of the first type of virtual keyboard.

The second display may display both the application control bar and aninput mode such as the virtual keyboard. Different gestures may enabledifferent gesture virtual keyboards. When a gesture virtual keyboard isenabled through a gesture, the display area and/or a display region ofthe application control bar may be determined based on a display region(a display area, a display location, and the like) of the gesturevirtual keyboard. In this way, the application control bar can flexiblyadapt to the gesture virtual keyboard, display on the second display ismore appropriate, neat, and beautiful, and user experience is improved.

With reference to any one of the twentieth aspect, or the foregoingeight possible embodiments of the twentieth aspect, in a ninth possibleembodiment of the twentieth aspect:

-   -   in response to a received second operation, a target application        interface is displayed on the second display, to obtain        handwriting content for the target application interface by        using the second display, where the second operation indicates        to enable a handwriting input mode of the target application;        and    -   after the target application interface is displayed on the        second display, the second display does not include the        application control bar.

When it is detected that a user enables the handwriting input modethrough the second operation, the target application interface may bedisplayed on the second display, to obtain handwriting content of thetarget application interface by using the second display. In this case,because the target application interface has been completely copied tothe second display, the application control bar on the second displaymay be hidden, to decrease display controls on the second display. Inthis way, display content on the second display is more concise andclearer, and the application control bar does not cause interferencewith handwriting input.

With reference to any one of the twentieth aspect, or the foregoing ninepossible embodiments of the twentieth aspect, in a tenth possibleembodiment of the twentieth aspect:

-   -   the first operation is used to switch an input mode to a        handwriting input mode;    -   in response to the received first operation, a handwriting input        region or a control key group related to the handwriting input        mode or both are displayed in the application control bar; and    -   when a user switches the input mode to the handwriting input        mode, the handwriting input region may be displayed in the        application control bar, so that the user can perform a        handwriting input operation more conveniently through the        application control bar, and operation efficiency is improved.        Alternatively, the control key group related to the handwriting        input mode, such as a pen, an eraser, a color, and a font, may        be displayed in the application control bar, so that the user        can operate the handwriting input mode through the application        control bar, and a more convenient operation is provided for the        user. Alternatively, both the handwriting input region and the        control key group related to the handwriting input mode may be        displayed in the application control bar, to achieve the        foregoing beneficial effects.

With reference to any one of the twentieth aspect, or the foregoing tenpossible embodiments of the twentieth aspect, in an eleventh possibleembodiment of the twentieth aspect, the method further includes:

-   -   obtaining a contact operation acting on the application control        bar;    -   in response to the contact operation, obtaining a first control        key corresponding to the contact operation, where the first        control key is located in the application control bar;    -   obtaining at least one first vibration feedback element that        matches the first control key from a plurality of vibration        feedback elements; and    -   indicating the first vibration feedback element to emit a        vibration wave, to perform a first feedback operation, where the        first feedback operation is used to prompt that the first        control key is a key of the application control bar.

A control region displayed on the second display may include a systemcontrol bar and an application control bar. When a user touches acontrol key in the application control bar, a feedback operation isprovided, so that the user can locate the application control bar andthe control key in the application control bar in the control regionwithout moving a line of sight to the second display. This helps theuser quickly locate a to-be-located control key in a changing process ofthe display area and the control key of the application control bar,greatly improving operation efficiency. On the contrary, based on a usehabit of the user, a feedback operation may be further set for a controlkey on the system control bar in the control region, so that the usercan locate the system control bar and a control key in the systemcontrol bar in the control region without moving a line of sight to thesecond display, greatly improving operation efficiency. In addition, afeedback operation may be further set on a control key that has animportant function or that is frequently used by the user in theapplication control bar, to help the user quickly locate a to-be-locatedcontrol key in a changing process of the display area and the controlkey of the application control bar, greatly improving operationefficiency.

With reference to any one of the twentieth aspect, or the foregoingeleven possible embodiments of the twentieth aspect, in a twelfthpossible embodiment of the twentieth aspect, the application control barmay be disabled in any one of the following manners:

-   -   disabling the application control bar based on a received        instruction for disabling the virtual keyboard;    -   disabling the application control bar based on a key instruction        of the virtual keyboard;    -   disabling the application control bar based on a gesture        instruction; and    -   disabling the application control bar based on a received        instruction for disabling a full-screen mode of an application.

With reference to any one of the twentieth aspect, or the foregoingtwelve possible embodiments of the twentieth aspect, in a thirteenthpossible embodiment of the twentieth aspect, the application control barmay be enabled in any one of the following manners:

-   -   activating the application control bar based on a received        instruction for activating the virtual keyboard;    -   activating the application control bar based on a key        instruction of the virtual keyboard;    -   activating the application control bar based on a gesture        instruction; and    -   activating the application control bar based on a received        instruction for enabling a full-screen mode of an application.

The foregoing manners of enabling and disabling the application controlbar are only examples. The foregoing design enables a user to flexiblyactivate or disable the application control region if any content isdisplayed on the second display. This provides a more convenientoperation for the user and improves user experience.

According to a twenty-first aspect, an embodiment of the presentinvention provides a screen display method. The screen display method isapplied to an electronic device including a first display and a seconddisplay. The screen display method includes:

-   -   displaying a target application interface on the first display,        where the target application interface includes a fifth control        key group;    -   displaying an application control bar on the second display; and    -   in response to a third operation on the target application        interface, displaying the fifth control key group in the        application control bar, and hiding the fifth control key group        in the target application interface.

A control key corresponding to a user operation is displayed in theapplication control bar based on an operation performed by the user onthe target application interface. A shortcut operation control keycorresponding to a current user operation may be always displayed in theapplication control bar. This provides a more convenient operation forthe user and improves user operation efficiency. In addition, after thecontrol key is displayed in the application control bar, display of suchcontrol key on the first display is removed. This can save the displayarea of the first display, and display content on the first displaybecomes more concise and clearer. In addition, after the control keydisplayed in the application control bar is not displayed on the firstdisplay, a size of original display content on the first display may beincreased, or new display content may be added based on the originaldisplay content. This provides a more convenient operation for the userand improves user experience.

With reference to the twenty-first aspect, in a first possibleembodiment of the twenty-first aspect, the screen display method furtherincludes:

-   -   in response to the third operation on the target application        interface, changing a display area of the application control        bar.

After the fifth control key group is displayed in the applicationcontrol bar, a quantity of control keys in the application control barmay change. In this case, the display area of the application controlbar may be adaptively adjusted, to optimize display of the control keysin the application control bar. In this way, display of the control keysin the application control bar better satisfies a use habit of the user,and user experience is improved.

With reference to the twenty-first aspect or the first possibleembodiment of the twenty-first aspect, in a second possible embodimentof the twenty-first aspect, before the displaying the fifth control keygroup in the application control bar, the screen display method furtherincludes:

-   -   the application control bar includes a sixth control key group,        where the sixth control key group is an initial control key set        for controlling a target application.

When the user starts the target application, an initial control keygroup for controlling the target application may be displayed in theapplication control bar. When the user performs an operation on thetarget application, the fifth control key group corresponding to acurrent user operation may be added based on the initial control keygroup, or some or all of the initial control key group may be replacedwith the fifth control key group corresponding to the current useroperation. In this way, the application control bar can always display acontrol key most related to the current user operation. This provides amore convenient operation for the user and improves user operationefficiency. In addition, after the initial control key group isdisplayed in the application control bar, these control keys in thetarget application interface may be removed. This can save the displayarea of the first display, and display content on the first displaybecomes more concise and clearer.

With reference to the twenty-first aspect or the first possibleembodiment of the twenty-first aspect, in a third possible embodiment ofthe twenty-first aspect, after the displaying the fifth control keygroup in the application control bar, the screen display method furtherincludes:

-   -   in response to a fourth operation on the target application        interface, displaying a seventh control key group in the        application control bar, and hiding the seventh control key        group in the target application interface.

Specifically, based on the third operation on the target applicationinterface, the user may continue to perform the fourth operation on thesame target application interface. When the user performs the fourthoperation on a target application, the seventh control key groupcorresponding to the fourth operation of the user may be added based onthe fifth control key group in the application control bar, or some orall of control keys in the fifth control key group in the applicationcontrol bar may be replaced with the seventh control key groupcorresponding to the fourth operation of the user. In addition, thefourth operation may further be displaying a new target application onthe first display. The fourth operation may be implemented by startingthe new target application, or may be displaying, on the first displaythrough the fourth operation, the interface of the target applicationthat originally runs in a background. When the new target applicationinterface is displayed on the first display, an original targetapplication interface on the first display may be hidden. In this case,the fifth control key group may be replaced with the seventh control keygroup. Alternatively, both the two target application interfaces may bedisplayed on the first display (for example, by using dual-screendisplay). In this case, the fifth control key group may be added basedon the seventh control key group, in other words, the seventh controlkey group and the fifth control key group are both displayed in theapplication control bar.

The control key in the application control bar is flexibly changed basedon a change of the user operation, and a control key most related to auser operation is always displayed in the application control bar. Thisprovides a more convenient operation for the user and improves operationefficiency.

With reference to any one of the twenty-first aspect, or the foregoingthree possible embodiments of the twenty-first aspect, in a fourthpossible embodiment of the twenty-first aspect:

-   -   the third operation is selecting a target object in the target        application interface; and    -   the fifth control key group is a control key for operating a        target object.

The third operation may be selecting the target object in the targetapplication interface. For example, shading of the target object isdeepened to indicate that the target object is selected. Alternatively,the third operation may be selecting the target object by moving acursor to the target object. Specifically, the target object selectedthrough the third operation may be a picture or text, and the fifthcontrol key group may include a control key related to text or pictureediting, so that the user can edit the text or the picture by using thecontrol key in the application control bar. The target object selectedthrough the third operation may be audio and a video, and the fifthcontrol key group may include a control key group related to audio andvideo control, so that the user can control the audio and the video byusing the control key in the application control bar.

With reference to any one of the twenty-first aspect, or the foregoingthree possible embodiments of the twenty-first aspect, in a fifthpossible embodiment of the twenty-first aspect:

-   -   the third operation is moving a cursor to a target location in        the target application interface; and    -   the fifth control key group is a control key in a menu bar that        is displayed when a right mouse button is clicked at the target        location.

When the user moves the cursor to the target location of the targetapplication interface, the control key in the menu bar that is displayedwhen the user right-clicks at a location of the cursor is displayed inthe application control bar. Right-clicking to display the control keyin the menu bar is designed based on a user intention, and is likely tosatisfy a current operation requirement of the user. In addition,directly right-clicking to display the control key in the menu bar canavoid secondary development of a developer, and shorten a developmentcycle.

With reference to any one of the twenty-first aspect, or the foregoingthree possible embodiments of the twenty-first aspect, in a sixthpossible embodiment of the twenty-first aspect:

-   -   the third operation is browsing content in a target region on        the target application interface through a slide gesture or        scrolling a mouse wheel; and    -   the fifth control key group is a thumbnail of the target region        and a locating box for quickly locating the target object in the        thumbnail.

Based on the foregoing setting, the user can quickly locate requiredtarget content by using the thumbnail of the target region and thelocating box of the target object in the thumbnail in the applicationcontrol bar. This can improve user operation efficiency.

According to a twenty-second aspect, an embodiment of the presentinvention provides an electronic device, including:

-   -   a first display, a second display, a memory, one or more        processors, and one or more programs, where the one or more        programs are stored in the memory, and when the one or more        processors execute the one or more programs, the electronic        device is enabled to perform the following operations:    -   displaying a target application interface on the first display;    -   displaying an application control bar on the second display; and    -   changing a first display area of the application control bar to        a second display area in response to a received first operation.

When a display area of the application control bar is the first displayarea, the application control bar includes a first control key group.

When a display area of the application control bar is the second displayarea, the application control bar includes a second control key group.

Both the first control key group and the second control key group arecontrol key sets for controlling the target application, and controlkeys included in the first control key group and the second control keygroup are not completely the same.

With reference to the twenty-second aspect, in a first possibleembodiment of the twenty-second aspect, when the one or more processorsexecute the one or more programs, the electronic device is enabled toperform the following operations:

-   -   before the first display area of the application control bar is        changed to the second display area, displaying a virtual        keyboard on the second display; and    -   after the first display area of the application control bar is        changed to the second display area, changing a display layout of        the virtual keyboard.

With reference to the twenty-second aspect or the first possibleembodiment of the twenty-second aspect, in a second possible embodimentof the twenty-second aspect, when the one or more processors execute theone or more programs, the electronic device is enabled to perform thefollowing operations:

-   -   before the first display area of the application control bar is        changed to the second display area, the target application        interface includes a third control key group;    -   the second display area is greater than the first display area;    -   the second control key group includes the first control key        group and the third control key group; and    -   after the first display area of the application control bar is        changed to the second display area, a target application        interface includes the third control key group.

With reference to the second possible embodiment of the twenty-secondaspect, in a third possible embodiment of the twenty-second aspect, whenthe one or more processors execute the one or more programs, theelectronic device is enabled to perform the following operation:

-   -   determining the third control key group based on the second        display area and a priority sequence of to-be-displayed control        keys in a to-be-displayed control key set of the target        application.

With reference to the twenty-second aspect or the first possibleembodiment of the twenty-second aspect, in a fourth possible embodimentof the twenty-second aspect, when the one or more processors execute theone or more programs, the electronic device is enabled to perform thefollowing operations:

-   -   before the first display area of the application control bar is        changed to the second display area, a target application        interface does not include a fourth control key group, where the        fourth control key group is a control key set for controlling        the target application;    -   the second display area is less than the first display area;    -   the second control key group is the first control key group        minus the fourth control key group; and    -   after the first display area of the application control bar is        changed to the second display area, the target application        interface includes some or all of the fourth control key group.

With reference to the fourth possible embodiment of the twenty-secondaspect, in a fifth possible embodiment of the twenty-second aspect, whenthe one or more processors execute the one or more programs, theelectronic device is enabled to perform the following operation:

-   -   determining the fourth control key group based on the second        display area and a priority sequence of control keys in the        first control key group or a location relationship of the        control keys in the first control key group.

With reference to any one of the twenty-second aspect, or the foregoingfive possible embodiments of the twenty-second aspect, in a sixthpossible embodiment of the twenty-second aspect, when the one or moreprocessors execute the one or more programs, the electronic device isenabled to perform the following operations:

-   -   the first operation is a gesture operation;    -   in response to the received first operation, the first display        area of the application control bar is changed to the second        display area which specifically includes:    -   in response to a gesture operation, a first type of virtual        keyboard corresponding to the gesture operation is selected from        a plurality of types of virtual keyboards, where virtual keys        included in different types of virtual keyboards in the        plurality of types of virtual keyboards are not completely the        same;    -   a first type of virtual keyboard is displayed by using the        second display; and    -   the second display area is determined based on a display region        of the first type of virtual keyboard.

With reference to any one of the twenty-second aspect, or the foregoingsix possible embodiments of the twenty-second aspect, in a seventhpossible embodiment of the twenty-second aspect, when the one or moreprocessors execute the one or more programs, the electronic device isenabled to perform the following operations:

-   -   in response to a received second operation, displaying a target        application interface on the second display, to obtain        handwriting content for the target application interface by        using the second display, where the second operation indicates        to enable a handwriting input mode of the target application;        and    -   after the target application interface is displayed on the        second display, the second display does not include the        application control bar.

The electronic device provided in the twenty-second aspect ofembodiments of the present invention can implement various possibleembodiments described in the twentieth aspect of embodiments of thepresent invention, and achieve all beneficial effects.

According to a twenty-third aspect, an embodiment of the presentinvention provides an electronic device, including:

-   -   a first display, a second display, a memory, one or more        processors, and one or more programs, where the one or more        programs are stored in the memory, and when the one or more        processors execute the one or more programs, the electronic        device is enabled to perform the following operations:    -   displaying a target application interface on the first display,        where the target application interface includes a fifth control        key group;    -   displaying an application control bar on the second display; and    -   in response to a third operation on the target application        interface, displaying the fifth control key group in the        application control bar, and hiding the fifth control key group        in the target application interface.

With reference to the twenty-third aspect, in a first possibleembodiment of the twenty-third aspect, when the one or more processorsexecute the one or more programs, before the displaying the fifthcontrol key group in the application control bar, the electronic deviceis enabled to perform the following operations:

-   -   the application control bar includes a sixth control key group,        where the sixth control key group is an initial control key set        for controlling a target application; and    -   the target application interface does not include a sixth        control key group.

With reference to the twenty-third aspect or the first possibleembodiment of the twenty-third aspect, in a second possible embodimentof the twenty-third aspect, when the one or more processors execute theone or more programs, after the displaying the fifth control key groupin the application control bar, the electronic device is enabled toperform the following operations:

-   -   displaying a seventh control key group in the application        control bar in response to a fourth operation on the target        application interface; and    -   the target application interface does not include the seventh        control key.

With reference to any one of the twenty-third aspect, or the foregoingtwo possible embodiments of the twenty-third aspect, in a third possibleembodiment of the twenty-third aspect:

-   -   the third operation is selecting a target object in the target        application interface; and    -   the fifth control key group is a control key for operating a        target object.

With reference to any one of the twenty-third aspect, or the foregoingtwo possible embodiments of the twenty-third aspect, in a fourthpossible embodiment of the twenty-third aspect:

-   -   the third operation is moving a cursor to a target location in        the target application interface; and    -   the fifth control key group is a control key in a menu bar that        is displayed when a right mouse button is clicked at the target        location.

With reference to any one of the twenty-third aspect, or the foregoingtwo possible embodiments of the twenty-third aspect, in a fifth possibleembodiment of the twenty-third aspect:

-   -   the third operation is browsing content in a target region on        the target application interface through a slide gesture or        scrolling a mouse wheel; and    -   the fifth control key group is a thumbnail of the target region        and a locating box for quickly locating the target object in the        thumbnail.

The electronic device provided in the twenty-third aspect of embodimentsof the present invention can implement various possible embodimentsdescribed in the twenty-first aspect of embodiments of the presentinvention, and achieve all beneficial effects.

According to a twenty-fourth aspect, an embodiment of the presentinvention provides a computer storage medium. The computer readablemedium stores a program. When the program is run on a computer, thecomputer is enabled to perform the screen display method according toany one of the twentieth aspect or the foregoing eleven possibleembodiments of the twentieth aspect, or implement the screen displaymethod according to any one of the twenty-first aspect or the sixthpossible embodiment of the twenty-first aspect, and achieve all theforegoing beneficial effects.

According to a twenty-fifth aspect, an embodiment of the presentinvention provides a computer program product. When the computer programproduct is run on a computer, the computer is enabled to perform thescreen display method according to any one of the twentieth aspect orthe foregoing eleven possible embodiments of the twentieth aspect, orimplement the screen display method according to any one of thetwenty-first aspect or the sixth possible embodiment of the twenty-firstaspect, and achieve all the foregoing beneficial effects.

BRIEF DESCRIPTION OF DRAWINGS

FIG. 1 is a schematic diagram of a structure of an electronic deviceaccording to an embodiment of this application;

FIG. 2 is another schematic diagram of a structure of an electronicdevice according to an embodiment of this application;

FIG. 3 is a schematic diagram of a structure of a touchscreen accordingto an embodiment of this application;

FIG. 4 is a schematic diagram of two arrangements of a plurality ofvibration feedback units in an electronic device according to anembodiment of this application;

FIG. 5 is a schematic cross-sectional view of a touchscreen according toan embodiment of this application;

FIG. 6 is a schematic diagram of an arrangement layout of a plurality ofvibration feedback units included in a vibration feedback moduleaccording to an embodiment of this application;

FIG. 7 is a schematic diagram of another structure of a touchscreenaccording to an embodiment of this application;

FIG. 8 is a schematic diagram of still another structure of atouchscreen according to an embodiment of this application;

FIG. 9 is a schematic flowchart of a feedback method according to anembodiment of this application;

FIG. 10 shows two schematic diagrams of a virtual keyboard in a feedbackmethod according to an embodiment of this application;

FIG. 11 shows two schematic diagrams of a first location region and asecond location region in a feedback method according to an embodimentof this application;

FIG. 12 is another schematic diagram of a first location region and asecond location region in a feedback method according to an embodimentof this application;

FIG. 13 is still another schematic diagram of a first location regionand a second location region in a feedback method according to anembodiment of this application;

FIG. 14 is a schematic diagram of a structure of an electronic deviceaccording to an embodiment of this application;

FIG. 15 is a schematic diagram of a structure of an electronic deviceaccording to an embodiment of this application;

FIG. 16 is a schematic diagram of an electronic device according to anembodiment of this application;

FIG. 17 is a schematic flowchart of a virtual keyboard processing methodaccording to an embodiment of this application;

FIG. 18 is a schematic diagram of a first gesture parameter in a virtualkeyboard processing method according to an embodiment of thisapplication;

FIG. 19 is a schematic diagram of relative angle information in avirtual keyboard processing method according to an embodiment of thisapplication;

FIG. 20 shows two schematic diagrams of a first region in a virtualkeyboard processing method according to an embodiment of thisapplication;

FIG. 21 is a schematic diagram of a first gesture operation in a virtualkeyboard processing method according to an embodiment of thisapplication;

FIG. 22 is another schematic diagram of a first gesture operation in avirtual keyboard processing method according to an embodiment of thisapplication;

FIG. 23 is a schematic diagram of a first type of virtual keyboard in avirtual keyboard processing method according to an embodiment of thisapplication;

FIG. 24 is another schematic diagram of a first type of virtual keyboardin a virtual keyboard processing method according to an embodiment ofthis application;

FIG. 25 is still another schematic diagram of a first type of virtualkeyboard in a virtual keyboard processing method according to anembodiment of this application;

FIG. 26 is further still another schematic diagram of a first type ofvirtual keyboard in a virtual keyboard processing method according to anembodiment of this application;

FIG. 27 is still another schematic diagram of a first type of virtualkeyboard in a virtual keyboard processing method according to anembodiment of this application;

FIG. 28 is further still another schematic diagram of a first type ofvirtual keyboard in a virtual keyboard processing method according to anembodiment of this application;

FIG. 29 is still another schematic diagram of a first type of virtualkeyboard in a virtual keyboard processing method according to anembodiment of this application;

FIG. 30 is a schematic diagram of a first setting interface in a virtualkeyboard processing method according to an embodiment of thisapplication;

FIG. 31 is another schematic diagram of a first setting interface in avirtual keyboard processing method according to an embodiment of thisapplication;

FIG. 32 is a schematic diagram of a custom gesture operation in avirtual keyboard processing method according to an embodiment of thisapplication;

FIG. 33 is further still another schematic diagram of a first type ofvirtual keyboard in a virtual keyboard processing method according to anembodiment of this application;

FIG. 34 is still another schematic diagram of a first type of virtualkeyboard in a virtual keyboard processing method according to anembodiment of this application;

FIG. 35 is further still another schematic diagram of a first type ofvirtual keyboard in a virtual keyboard processing method according to anembodiment of this application;

FIG. 36 is a schematic diagram of a second virtual key in a virtualkeyboard processing method according to an embodiment of thisapplication;

FIG. 37(a) to FIG. 37(c) show another schematic diagram of a secondvirtual key in a virtual keyboard processing method according to anembodiment of this application;

FIG. 38 is another schematic flowchart of a virtual keyboard processingmethod according to an embodiment of this application;

FIG. 39 is a schematic diagram of a structure of an electronic deviceaccording to an embodiment of this application;

FIG. 40 is a schematic diagram of a structure of an electronic deviceaccording to an embodiment of this application;

FIG. 41 is a schematic diagram of a structure of an electronic deviceaccording to an embodiment of this application;

FIG. 42A and FIG. 42B show a schematic flowchart of an applicationinterface processing method according to an embodiment of thisapplication;

FIG. 43 is a schematic diagram of a display interface of a seconddisplay in an application interface processing method according to anembodiment of this application;

FIG. 44 is a schematic flowchart of an application interface processingmethod according to an embodiment of this application;

FIG. 45 is another schematic flowchart of an application interfaceprocessing method according to an embodiment of this application;

FIG. 46 is a schematic diagram of various holding postures in anapplication interface processing method according to an embodiment ofthis application;

FIG. 47 is an interface schematic diagram of a first applicationinterface in an application interface processing method according to anembodiment of this application;

FIG. 48 shows two interface schematic diagrams of a first applicationinterface in an application interface processing method according to anembodiment of this application;

FIG. 49 is a schematic diagram of a first contact operation in anapplication interface processing method according to an embodiment ofthis application;

FIG. 50 is a schematic diagram of a display interface of a firstapplication interface in an application interface processing methodaccording to an embodiment of this application;

FIG. 51 is a schematic flowchart of an application interface processingmethod according to an embodiment of this application;

FIG. 52 is a schematic flowchart of an application interface processingmethod according to an embodiment of this application;

FIG. 53A and FIG. 53B show a schematic flowchart of an applicationinterface processing method according to an embodiment of thisapplication;

FIG. 54 is a schematic diagram of a display interface of a firstapplication interface in an application interface processing methodaccording to an embodiment of this application;

FIG. 55 is a schematic diagram of a display interface of a firstapplication interface in an application interface processing methodaccording to an embodiment of this application;

FIG. 56 is a schematic diagram of a display interface of a firstapplication interface in an application interface processing methodaccording to an embodiment of this application;

FIG. 57 is a schematic diagram of a display interface of a firstapplication interface in an application interface processing methodaccording to an embodiment of this application;

FIG. 58 is a schematic diagram of a structure of an electronic deviceaccording to an embodiment of this application;

FIG. 59 is a schematic diagram of a structure of an electronic deviceaccording to an embodiment of this application;

FIG. 60 shows a dual-screen electronic device according to an embodimentof the present invention;

FIG. 61 shows an application scenario according to an embodiment of thepresent invention;

FIG. 62 shows a screen display method according to an embodiment of thepresent invention;

FIG. 63A shows a display manner of a control region according to anembodiment of the present invention;

FIG. 63B shows another display manner of a control region according toan embodiment of the present invention;

FIG. 63C shows another display manner of a control region according toan embodiment of the present invention;

FIG. 64A shows a method for activating a control region according to anembodiment of the present invention;

FIG. 64B shows another method for activating a control region accordingto an embodiment of the present invention;

FIG. 64C shows another method for activating a control region accordingto an embodiment of the present invention;

FIG. 64D shows another method for activating a control region accordingto an embodiment of the present invention;

FIG. 65A shows a correspondence manner between a user operation and acontrol key group according to an embodiment of the present invention;

FIG. 65B shows another correspondence manner between a user operationand a control key group according to an embodiment of the presentinvention;

FIG. 65C shows another correspondence manner between a user operationand a control key group according to an embodiment of the presentinvention;

FIG. 65D shows another correspondence manner between a user operationand a control key group according to an embodiment of the presentinvention;

FIG. 65E shows another correspondence manner between a user operationand a control key group according to an embodiment of the presentinvention;

FIG. 65F shows another correspondence manner between a user operationand a control key group according to an embodiment of the presentinvention;

FIG. 66A shows a display manner of a control region according to anembodiment of the present invention;

FIG. 66B shows another display manner of a control region according toan embodiment of the present invention;

FIG. 67 shows a layout manner of display content of a control regionaccording to an embodiment of the present invention;

FIG. 68 shows a priority setting manner according to an embodiment ofthe present invention;

FIG. 69 shows another priority setting manner according to an embodimentof the present invention;

FIG. 70A shows a method for disabling a control region according to anembodiment of the present invention;

FIG. 70B shows another method for disabling a control region accordingto an embodiment of the present invention;

FIG. 70C shows another method for disabling a control region accordingto an embodiment of the present invention;

FIG. 70D shows another method for disabling a control region accordingto an embodiment of the present invention;

FIG. 71 shows another screen display method according to an embodimentof the present invention;

FIG. 72 shows another screen display method according to an embodimentof the present invention;

FIG. 73A shows a method for changing a display area of an applicationcontrol bar according to an embodiment of the present invention;

FIG. 73B shows a method for increasing a display area of an applicationcontrol bar according to an embodiment of the present invention;

FIG. 73C shows a method for increasing a display area of an applicationcontrol bar according to an embodiment of the present invention;

FIG. 74A shows another method for changing a display area of anapplication control bar according to an embodiment of the presentinvention;

FIG. 74B shows another method for increasing a display area of anapplication control bar according to an embodiment of the presentinvention;

FIG. 74C shows another method for increasing a display area of anapplication control bar according to an embodiment of the presentinvention;

FIG. 75A shows another method for changing a display area of anapplication control bar according to an embodiment of the presentinvention;

FIG. 75B shows another method for increasing a display area of anapplication control bar according to an embodiment of the presentinvention;

FIG. 75C shows another method for increasing a display area of anapplication control bar according to an embodiment of the presentinvention;

FIG. 76A-1 to FIG. 76A-3 show a method for changing a display area and acontrol key of an application control bar based on a user operationaccording to an embodiment of the present invention;

FIG. 76B-1 to FIG. 76B-3 show shows another method for changing adisplay area and a control key of an application control bar based on auser operation according to an embodiment of the present invention;

FIG. 77A shows a gesture control method according to an embodiment ofthe present invention;

FIG. 77B shows another gesture control method according to an embodimentof the present invention;

FIG. 77C shows another gesture control method according to an embodimentof the present invention;

FIG. 77D shows another gesture control method according to an embodimentof the present invention;

FIG. 78A shows another gesture control method according to an embodimentof the present invention;

FIG. 78B shows another gesture control method according to an embodimentof the present invention;

FIG. 79 shows another gesture control method according to an embodimentof the present invention;

FIG. 80A shows a specific embodiment of a screen display methodaccording to an embodiment of the present invention;

FIG. 80B shows another specific embodiment of a screen display methodaccording to an embodiment of the present invention;

FIG. 80C shows another specific embodiment of a screen display methodaccording to an embodiment of the present invention;

FIG. 80D shows another specific embodiment of a screen display methodaccording to an embodiment of the present invention;

FIG. 80E shows another specific embodiment of a screen display methodaccording to an embodiment of the present invention;

FIG. 80F shows another specific embodiment of a screen display methodaccording to an embodiment of the present invention;

FIG. 80G shows another specific embodiment of a screen display methodaccording to an embodiment of the present invention;

FIG. 81 shows an electronic device according to an embodiment of thepresent invention; and

FIG. 82 shows another electronic device according to an embodiment ofthe present invention.

DESCRIPTION OF EMBODIMENTS

In the specification, claims, and accompanying drawings of thisapplication, the terms “first”, “second”, and the like are intended todistinguish between similar objects but do not necessarily indicate aspecific order or sequence. It should be understood that the terms usedin such a way are interchangeable in proper circumstances, and this isonly a discrimination manner for describing objects having a sameattribute in embodiments of this application. In addition, the terms“include”, “contain” and any other variants mean to cover anon-exclusive inclusion, so that a process, method, system, product, ordevice that includes a series of units is not necessarily limited tothose units, but may include other units not expressly described orinherent to such a process, method, system, product, or device.

The following describes embodiments of this application with referenceto the accompanying drawings. A person of ordinary skill in the art maylearn that, with development of technologies and emergence of a newscenario, the technical solutions provided in embodiments of thisapplication are also applicable to a similar technical problem.

Embodiment 1

This embodiment of this application may be applied to variousapplication scenarios in which input is performed by using a virtualkeyboard. For example, in an application scenario such as using a textinput application, producing a power point (PPT), browsing a web page,playing a video, playing music, and using a navigation application, auser may input by using the virtual keyboard. In the foregoing scenario,it is a difficult task to implement touch typing on a touchscreen.

To resolve the foregoing problem, an embodiment of this applicationprovides a feedback method. The feedback method is applied to anelectronic device provided with a touchscreen. The electronic deviceobtains first location information of a first contact point on thetouchscreen, obtains, based on the first location information, a firstvirtual key corresponding to the first contact point. If the firstvirtual key is an anchor point key, the electronic device performs afirst feedback operation, to prompt that the first virtual key is ananchor point key. This helps the user cultivate a muscle memory for theanchor point key. Touch typing training is performed based on the musclememory for the anchor point key, to reduce difficulty in implementingtouch typing on the touchscreen.

The feedback method provided in this embodiment of this application maybe applied to an electronic device shown in FIG. 1 . FIG. 1 and FIG. 2show two schematic diagrams of a structure of an electronic deviceaccording to an embodiment of this application. First refer to FIG. 1 .An electronic device 1 includes a processor 10 and a touchscreen 20. Thetouchscreen 20 includes a tactile sensing module 100 and a vibrationfeedback module 200. The vibration feedback module 200 includes aplurality of vibration feedback elements.

Specifically, the processor 10 obtains first location information of afirst contact point on the touchscreen by using the tactile sensingmodule 100. If the processor 10 determines that a first virtual keycorresponding to the first contact point is an anchor point key, theprocessor 10 obtains, from the plurality of vibration feedback elementsincluded in the vibration feedback module 200, a vibration feedbackelement that matches the first virtual keyboard, and emits a vibrationwave by using the vibration feedback element that matches the firstvirtual key. In this case, vibration feedback is sent at the firstcontact point (that is, within a preset range around the first contactpoint on the touchscreen) by using the touchscreen, to prompt that thefirst virtual key touched by a user is an anchor point key. It should benoted that the vibration feedback is not full-screen vibration feedback,but vibration feedback for the first contact point, and a vibrationfeedback intensity at the first contact point is the largest.

In some application scenarios, as shown in FIG. 2 , an electronic device1 includes a display 30 and a touchscreen 20. A virtual keyboard isdisplayed on the touchscreen 20. There is an anchor point key on thevirtual keyboard. In other words, the touchscreen 20 needs to havefunctions of displaying the virtual keyboard and performing vibrationfeedback. In this case, a display module further needs to be disposed onthe touchscreen 20. In some other application scenarios, the electronicdevice 1 may alternatively be a virtual reality (VR) device, anaugmented reality (AR) device, a mixed reality (MR) device, or the like.In other words, the touchscreen 20 may not need to display a virtualkeyboard, and only needs to perform vibration feedback. In this case, nodisplay module needs to be disposed in the touchscreen 20. It should beunderstood that in subsequent embodiments, only an example in which thedisplay module is disposed in the touchscreen 20 is used fordescription.

Further, FIG. 3 is a schematic diagram of a structure of a touchscreenaccording to an embodiment of this application. The touchscreen 20 mayfurther include a cover 300 and a display module 400. FIG. 3 shows anexample in which the cover 300 and a tactile sensing module 100 areintegrated. The cover 300 and the tactile sensing module 100 mayalternatively be separated from each other.

The cover 300 may be made of a glass-type transparent rigid material, aflexible transparent organic material, another material, or the like.The tactile sensing module 100 may be specifically represented as atactile sensing film. The tactile sensing film may be specifically acapacitive tactile sensing film, a pressure tactile sensing film, atemperature tactile sensing film, another type of film, or the like.Further, for example, the tactile sensing film may be specifically madeof indium tin oxide (ITO) wire mesh, carbon nanotube mesh with bumps, oranother material, which is not exhaustively described herein. In thisembodiment of this application, a plurality of specific representationforms of the vibration feedback element are provided, improvingembodiment flexibility of this solution.

The display module 400 is configured to display a virtual keyboard. Thedisplay module 400 and the tactile sensing module 100 may be integrated,or may be separated from each other. FIG. 3 shows only an example inwhich the display module 400 and the tactile sensing module 100 areseparated from each other. The display module 400 may be specificallyrepresented as a display panel. The display panel may be specifically aliquid crystal display (LCD), an active-matrix organic light-emittingdiode (AMOLED) panel, another type of display panel, or the like, whichis not exhaustively described herein.

In an embodiment, as shown in FIG. 3 , a vibration feedback module 200may be specifically represented as a vibration feedback layer. Thevibration feedback layer is located below the tactile sensing module100, and may be specifically located above the display module 400, ormay be located below the display module 400.

The vibration feedback module 200 is provided with a plurality ofvibration feedback units 201. Each dark gray diamond in FIG. 3represents one vibration feedback unit. One vibration feedback unit 201may include one or more vibration feedback elements. In one case, thevibration feedback layer may be specifically represented as a vibrationfeedback film, and the vibration feedback film is partitioned into aplurality of vibration feedback elements. In another case, the vibrationfeedback element may be specifically represented as a piezoelectricceramic sheet, a linear motor, or another type of electronic element,which is not exhaustively described herein.

Further, the plurality of vibration feedback units 201 may be arrangedin a plurality of manners. In one case, refer to FIG. 3 . A layout ofthe virtual keyboard is completely the same as that of a physicalkeyboard. The physical keyboard may be a keyboard including 61 keys, akeyboard having 87 keys, a keyboard having 104 keys, a keyboard having108 keys, an ergonomic keyboard, another type of physical keyboard, orthe like. A specific virtual keyboard may be flexibly designed withreference to an actual application scenario. The plurality of vibrationfeedback units 201 may be arranged in a one-to-one correspondence with aplurality of virtual keys. In other words, each virtual key correspondsto one vibration feedback unit 201 in location.

In another case, FIG. 4 is a schematic diagram of two arrangements of aplurality of vibration feedback units in an electronic device accordingto an embodiment of this application. FIG. 4 includes a schematicsubdiagram (a) and a schematic subdiagram (b). First refer to theschematic subdiagram (a) in FIG. 4 , a plurality of vibration feedbackunits 201 are arranged in a matrix manner. Refer to the schematicsubdiagram (b) in FIG. 4 . The plurality of vibration feedback units 201are arranged in a form similar to a chess board. Each gray box in theschematic subdiagram (a) in FIG. 4 and the schematic subdiagram (b) inFIG. 4 represents one vibration feedback unit 201.

In another embodiment, as shown in FIG. 5 and FIG. 6 , a plurality ofvibration feedback units 201 (namely, a plurality of vibration feedbackelements) may be located around a display module 400. FIG. 5 is aschematic cross-sectional view of a touchscreen according to anembodiment of this application. FIG. 6 is a schematic diagram of anarrangement layout of a plurality of vibration feedback units includedin a vibration feedback module according to an embodiment of thisapplication. First refer to FIG. 5 . The touchscreen 20 includes a cover300, a tactile sensing module 100, a display module 400, a vibrationfeedback element, a support structure of the vibration feedback element,another module in the touchscreen, and a bottom plate. FIG. 5 shows anexample in which the cover 300 and the tactile sensing module 100 areintegrated. A plurality of vibration feedback elements are parallel tothe display module 400, and may directly support the cover 300. Itshould be noted that, in another embodiment, the cover 300 and thetactile sensing module 100 may alternatively be independent of eachother, and a plurality of vibration feedback units may be parallel tothe tactile sensing module 100. With reference to FIG. 5 and FIG. 6 , itcan be learned that the plurality of vibration feedback units 201 arearranged in an encircling manner. In other words, the plurality ofvibration feedback units 201 encircle the display module 400.Correspondingly, in another embodiment, the plurality of vibrationfeedback units 201 may alternatively encircle the tactile sensing module100.

Further, there may be a gap layer between the display module 400 and thecover 300, to provide available activity space for the vibrationfeedback element to emit a vibration wave. The display module 400 andthe cover 300 may alternatively be bonded by a transparent adhesivematerial. The support structure of the vibration feedback element andthe bottom plate may be integrated, or may be separated from each other.This embodiment of this application provides a plurality of arrangementlayout manners of the plurality of vibration feedback units, improvingembodiment flexibility of this solution.

It should be noted that the foregoing enumeration of arrangement layoutmanners of the plurality of vibration feedback units is only for ease ofunderstanding of this solution. The plurality of vibration feedbackunits may alternatively be arranged in another manner. A specificembodiment should be determined with reference to an actual productform, and is not exhaustively described herein.

Optionally, the touchscreen 20 may further include a pressure sensingmodule. The pressure sensing module is configured to detect a pressurechange and location on the touchscreen.

In an embodiment, the pressure sensing module and the vibration feedbackmodule 200 may be two independent modules. In this case, the pressuresensing module may be disposed above the vibration feedback module 200,or may be disposed below the vibration feedback module 200. The pressuresensing module may be specifically represented as a pressure sensingfilm, a distributed pressure sensor, or another form, which is notexhaustively described herein.

In another embodiment, the pressure sensing module and the vibrationfeedback module 200 may alternatively be integrated. In this case, thevibration feedback module 200 may also be referred to as a pressuresensing module, and the vibration feedback element may also be referredto as a pressure sensing element. In this embodiment, the vibrationfeedback element may be specifically a piezoelectric ceramic sheet, apiezoelectric polymer (for example, a piezoelectric film), apiezoelectric composite, another type of element, or the like. Thepiezoelectric composite is a composite material obtained by using thepiezoelectric ceramic sheet and the piezoelectric polymer. Further, inone case, a plurality of vibration feedback elements included in thevibration feedback module 200 (which may also be referred to as thepressure sensing module) may be classified. A second vibration feedbackelement in the plurality of vibration feedback elements is configured tocollect a pressure value. A third vibration feedback element in theplurality of vibration feedback elements is configured to emit avibration wave to perform vibration feedback. The second vibrationfeedback element and the third vibration feedback element are differentvibration feedback elements. For example, one vibration feedback unit201 includes two vibration feedback elements. One vibration feedbackelement in the same vibration feedback unit 201 is configured to collecta pressure value, and the other vibration feedback element is configuredto emit a vibration wave to perform vibration feedback.

In another case, a plurality of vibration feedback elements in thevibration feedback module 200 (which may also be referred to as thepressure sensing module) are configured to collect a pressure value in afirst time period, and are configured to emit a vibration wave in asecond time period. The first time period is different from the secondtime period. For example, the plurality of vibration feedback elementsin the vibration feedback module 200 (which may also be referred to asthe pressure sensing module) may be configured to collect a pressurevalue in a default state. When a first pressure value threshold isreached (that is, if it is determined that a press operation isreceived), the plurality of vibration feedback elements are configuredto emit a vibration wave to perform vibration feedback.

In this embodiment of this application, the touchscreen is furtherprovided with the pressure sensing module for collecting the pressurevalue. In this way, both the location information and the pressure valueof the contact point can be obtained, so that further detailedmanagement may be performed on the contact operation obtained by usingthe touchscreen. In addition, the pressure sensing module and thevibration feedback module are integrated. This helps reduce a thicknessof the touchscreen, further improving convenience of the electronicdevice.

Optionally, a tactile characteristic of the cover 300 of the touchscreen20 is changeable. The tactile characteristic includes any one or more ofthe following characteristics: a sliding friction coefficient, a stickslip property, a temperature, another tactile characteristic, or thelike. Further, the stick slip property represents a change speed of thesliding friction coefficient. Further, the tactile characteristic of theentire cover 300 may be changed, or only a tactile characteristic of acontact point on the cover 300 may be changed.

Specifically, in an embodiment, FIG. 7 is a schematic diagram of astructure of a touchscreen according to an embodiment of thisapplication. The touchscreen 20 may further include an ultrasonic module500. The ultrasonic module 500 is configured to emit an ultrasonic waveto change a tactile characteristic of a cover 300. This may bespecifically implemented by using an ultrasonic vibration film, apiezoelectric film, a speaker, another component, or the like, which isnot exhaustively described herein. The ultrasonic module 500 may beconfigured below the cover 300, and may be specifically configured abovea tactile sensing module 100 or a display module 400, or may beconfigured below the tactile sensing module 100 or the display module400. FIG. 7 shows an example in which the ultrasonic module 500 isconfigured above the tactile sensing module 100. It should be understoodthat the example in FIG. 7 is only for ease of understanding of thissolution, and is not intended to limit this solution.

In another embodiment, FIG. 8 is a schematic diagram of a structure of atouchscreen according to an embodiment of this application. Thetouchscreen 20 further includes an electrostatic module 600. Theelectrostatic module 600 is configured to generate an electrical signal,to change a tactile characteristic of a cover. The electrostatic module600 may be specifically represented as an electrostatic film layer, andmay be configured below a cover 300, and may be specifically configuredabove a tactile sensing module 100 or a display module 400, or may beconfigured below a tactile sensing module 100 or a display module 400.FIG. 8 shows an example in which the electrostatic module 600 isconfigured above the tactile sensing module 100. It should be understoodthat the example in FIG. 8 is only for ease of understanding of thissolution, and is not intended to limit this solution.

In this embodiment of this application, the touchscreen may furtherchange a tactile characteristic of the cover by disposing the ultrasonicmodule or the electrostatic module, to provide more abundant tactilefeedback. In this way, the user may implement touch typing training onthe touchscreen based on the more abundant tactile feedback, to furtherreduce difficulty in implementing touch typing on the touchscreen.

Based on the foregoing descriptions, an embodiment of this applicationprovides a feedback method, which may be applied to the electronicdevices shown in FIG. 1 to FIG. 8 . Specifically, FIG. 9 is a schematicflowchart of a feedback method according to an embodiment of thisapplication. The feedback method provided in this embodiment of thisapplication may include the following operations.

901: An electronic device detects a first contact operation acting on atouchscreen, and obtains, in response to the first contact operation,first location information of a first contact point corresponding to thefirst contact operation.

In this embodiment of this application, the electronic device maydetect, in real time, the first contact operation acting on thetouchscreen. When detecting, by using the touchscreen, the first contactoperation input by the user, the electronic device may obtain, inresponse to the first contact operation, a quantity of at least onefirst contact point on the touchscreen and first location information ofeach first contact point that are collected by using a tactile sensingmodule on the touchscreen. The at least one first contact point mayinclude only a newly added contact point on the touchscreen, or mayinclude all contact points on the touchscreen. The first locationinformation is established based on a touchscreen coordinate system. Acentral point of the touchscreen, an upper left corner vertex, a lowerleft corner vertex, an upper right corner vertex, a lower right cornervertex, any location point on the touchscreen, or another location pointmay be used as an origin of the coordinate system.

More specifically, if the at least one first contact point may includeonly the newly added contact point on the touchscreen, when a virtualkeyboard on the electronic device is enabled, a touch signalcorresponding to each contact point on the touchscreen is continuouslydetected by using the tactile sensing module on the touchscreen. If acontact signal of a new contact point on the touchscreen is detected,location information of the at least one newly added first contact pointis collected in time. For example, when a user starts a text entryapplication and invokes the virtual keyboard, a plurality of new firstcontact points on the touchscreen may be obtained from a time point whentwo hands are not in contact with the touchscreen to a time point whentwo hands are placed in a standard finger location. For another example,when the user performs keyboard input, when one finger leaves a virtualkey location, moves down or slides into a key location of anothervirtual key location, a plurality of new first contact points appear onthe touchscreen, and a new first contact point on the touchscreen may beobtained. It should be understood that, the foregoing examples are onlyfor ease of understanding of this solution, and are not intended tolimit this solution. In this embodiment of this application, the virtualkeyboard may be represented as any type of keyboard. For example, thevirtual keyboard may be a full-size keyboard, a numeric keyboard, afunction keyboard. Alternatively, the virtual keyboard may be acollective name of all operation keys on the touchscreen.

It should be noted that anti-accidental touch processing further needsto be performed in operation 901. Specifically, a finger of the user maygenerate a contact point on the touchscreen, and a palm, a small arm, ora back of a hand of the user, a capacitive pen, or the like may alsogenerate a contact point on the touchscreen. In other words, theelectronic device may collect, by using the tactile sensing module ofthe touchscreen, a touch signal of the contact point that is generatedby the palm, the small arm, or the back of the hand of the user, thecapacitive pen, or the like instead of the finger of the user. Afterobtaining a touch signal corresponding to each newly added contact pointon the touchscreen, a processor of the electronic device needs toperform filtering analysis, to filter out the obtained touch signals ofthe newly added contact points except a touch signal of a newly addedcontact point triggered by the finger. In other words, the first contactpoint includes only the newly added contact point triggered by thefinger of the user.

In this embodiment of this application, when using a physical keyboard,the user usually focuses on an actual key that is newly touched. Thissolution generates feedback only for a newly added contact point, tobetter simulate user experience of inputting by using the physicalkeyboard. In addition, the feedback is generated only for the newlyadded contact point. It is easier to establish a memory relationshipbetween the user and the newly added contact point, further reducingdifficulty in touch typing training on the touchscreen.

Optionally, the touchscreen may be further provided with a proximitysensing module. When the virtual keyboard in the electronic device isenabled, the electronic device senses a movement track of the finger ofthe user on the touchscreen by using the proximity sensing module on thetouchscreen, and estimates an estimated contact point between the fingerand the touchscreen.

Optionally, before operation 901, the electronic device may furtherselect, in response to a detected first gesture operation, a first typeof virtual keyboard corresponding to the first gesture operation from aplurality of types of virtual keyboards. Virtual keys included indifferent types of virtual keyboards in the plurality of types ofvirtual keyboards are not completely the same. The electronic devicedisplays the first type of virtual keyboard by using the touchscreen. Alocation of the first type of virtual keyboard on the touchscreen isfixed in the process of displaying the first type of virtual keyboard.If the electronic device determines that the first type of virtualkeyboard is a virtual keyboard whose display location is fixed in adisplay process, the electronic device obtains the first locationinformation of the first contact point on the touchscreen in real time,that is, triggers operation 901. Concepts of the first gesture operationand the plurality of types of virtual keyboards, and the specificembodiments of the foregoing operations are all described in followingEmbodiment 2. Details are not described herein again.

902: The electronic device obtains a pressure value corresponding to thefirst contact point.

In some embodiments of this application, when obtaining, by using thetouchscreen, the first contact operation input by the user, theelectronic device may further collect, by using a pressure sensingmodule on the touchscreen, a pressure value corresponding to the atleast one first contact point on the touchscreen. The pressure valuecorresponding to the at least one first contact point on the touchscreenmay include a pressure value of each of the at least one first contactpoint, or may be shared by the at least one first contact point.

Specifically, in one case, if the pressure sensing module on thetouchscreen is independent, the pressure sensing module may directlycollect the pressure value of each of the at least one first contactpoint.

In another case, if the pressure sensing module and the vibrationfeedback module are integrated, and the vibration feedback unitsincluded in the vibration feedback module are in a one-to-onecorrespondence with virtual keys on the virtual keyboard, the pressuresensing module may also directly collect the pressure value of each ofthe at least one first contact point.

In another case, the pressure sensing module and the vibration feedbackmodule are integrated, and the vibration feedback units are not in aone-to-one correspondence with the virtual keys. For example, aplurality of vibration feedback units are arranged in the plurality ofarrangement manners shown in FIG. 4 to FIG. 6 . In other words, theplurality of vibration feedback units are arranged in a matrix manner, achess manner, or an encircling manner. The electronic device may obtaina reading of each pressure sensing element (which may also be referredto as a vibration feedback element) in the pressure sensing module.Further, in an embodiment, the electronic device may obtain the pressurevalue of each (namely, each pressure central point) of the at least onefirst contact point (namely, each pressure central point) based on acoordinate location of each pressure sensing element and a pressurevalue collected by each pressure sensing unit according to a principleof same moments.

In another embodiment, the electronic device may alternatively calculatea pressure value of the entire touchscreen based on the pressure valuecollected by each pressure sensing element, and determine a pressurevalue of each of the at least one contact point as the pressure value ofthe entire touchscreen.

903: The electronic device obtains, based on the first locationinformation of the first contact point, a first virtual keycorresponding to the first contact point.

In some embodiments of this application, after obtaining first locationinformation of each of the at least one first contact point, theelectronic device may obtain, one by one, a first virtual keycorresponding to each first contact point. The first virtual key is avirtual key on the virtual keyboard.

Specifically, the following describes a process of obtaining the firstvirtual key corresponding to the first contact point. Because theelectronic device may display one or more types of virtual keyboards,the electronic device may store location information of each virtual keyon each type of virtual keyboard. The electronic device determines acurrently displayed virtual keyboard from the plurality of types ofvirtual keyboards, obtains location information of each virtual key onthe currently displayed virtual keyboard, and matches the first locationinformation of the first contact point with the location information ofeach virtual key on the currently displayed virtual keyboard, todetermine the first virtual key corresponding to the first contactpoint. For more intuitive understanding of this solution, refer to FIG.10 . FIG. 10 shows two schematic diagrams of a virtual keyboard in afeedback method according to an embodiment of this application. Aschematic subdiagram (a) in FIG. 10 and a schematic subdiagram (b) inFIG. 10 show two types of virtual keyboards on the touchscreen. Theschematic subdiagram (a) in FIG. 10 shows a virtual keyboardcorresponding to a physical keyboard with 74 keys, and the schematicsubdiagram (b) in FIG. 10 shows an ergonomic keyboard. It should beunderstood that the example in FIG. 10 is only for ease of understandingthe virtual keyboard in this solution, and is not intended to limit thissolution.

For example, a currently displayed virtual keyboard is an ergonomickeyboard. After determining the first location information of the firstcontact point on the touchscreen by using the tactile sensing module ofthe touchscreen, the electronic device compares the first locationinformation with location information of each virtual key on theergonomic keyboard, to determine that the first contact point is locatedin a location region of a virtual key K. Then, the electronic devicedetermines that the first virtual key corresponding to the first contactpoint is the key K. It should be understood that the examples herein areonly for ease of understanding, and are not intended to limit thissolution.

More specifically, in an embodiment, the first contact point may berepresented as a location region in an actual situation, and then thefirst location information may describe a location region. Therefore,the electronic device may obtain coordinates of a central point of thefirst location information, and match the coordinates of the centralpoint of the first location information with location information ofeach virtual key on the currently displayed virtual keyboard, todetermine the first virtual key corresponding to the first contactpoint.

In another embodiment, the electronic device may further directly matchthe first location information of the first contact point with thelocation information of each virtual key on the currently displayedvirtual keyboard, and select the first virtual key from the virtualkeys. The location information of the first virtual key has a largestintersection with the first location information.

904: The electronic device determines, based on the pressure valuecorresponding to the first contact point, whether the contact operationcorresponding to the first contact point is a press operation or a touchoperation. If the contact operation is a press operation, operation 905is performed; or if the contact operation is a touch operation,operation 908 is performed.

In some embodiments of this application, the electronic device maypreset a first pressure value threshold and a second pressure valuethreshold. The first pressure value threshold is a threshold of a pressoperation, and the second pressure value threshold is a threshold of atouch operation. For any first contact point in the at least one firstcontact point, after obtaining the pressure value corresponding to thefirst contact point, the electronic device may determine whether thepressure value corresponding to the first contact point is greater thanor equal to the first pressure value threshold. If the pressure valuecorresponding to the first contact point is greater than or equal to thefirst pressure value threshold, the electronic device determines thatthe contact operation corresponding to the first contact point is apress operation. If the pressure value corresponding to the firstcontact point is greater than or equal to the second pressure valuethreshold and is less than the first pressure value threshold, theelectronic device determines that the contact operation corresponding tothe first contact point is a touch operation. If the pressure valuecorresponding to the first contact point is less than the secondpressure value threshold, the electronic device determines that thecontact operation corresponding to the first contact point is an idleoperation, and does not perform feedback.

A value of the first pressure value threshold is greater than a value ofthe second pressure value threshold. For example, a value range of thefirst pressure value threshold may be 50 gram-force to 60 gram-force.For example, the value of the first pressure value threshold is 55gram-force, 60 gram-force, or another value. A value range of the secondpressure value threshold may be 0 gram-force to 30 gram-force. Forexample, the value of the first pressure value threshold is 15gram-force, or 20 gram-force. These are not limited herein.

905: The electronic device determines whether the first virtual key isan anchor point key. If the first virtual key is an anchor point key,operation 906 is performed; or if the first virtual key is not an anchorpoint key, operation 908 is performed.

In this embodiment of this application, in one case, a location of thefirst type of virtual keyboard is fixed in the process of displaying thefirst type of virtual keyboard; in another case, a location of the firsttype of virtual keyboard can be moved in the process of displaying thefirst type of virtual keyboard.

If the location of the first type of virtual keyboard is fixed in theprocess of displaying the first type of virtual keyboard, in anembodiment, the electronic device may prestore a specific key as ananchor point key and a specific key as a non-anchor point key. In thiscase, operation 903 is a mandatory operation. After determining thefirst virtual key corresponding to the first contact point in operation903, the electronic device may determine whether the first virtual keyis an anchor point key. In another embodiment, the electronic device mayprestore a specific location region on the touchscreen as a locationregion of the anchor point key, and a specific location region on thetouchscreen as a location region of the non-anchor point key. In thiscase, operation 903 is an optional operation. The electronic devicedirectly determines, based on the first location information of thefirst contact point obtained in operation 901, whether the first contactpoint is located in the location region of the anchor point key, inother words, determines whether the first virtual key corresponding tothe first location information is an anchor point key.

If the location of the first type of virtual keyboard can be moved inthe process of displaying the first type of virtual keyboard, operation903 is a mandatory operation. The electronic device may store locationinformation of each virtual key on the first type of virtual keyboard.After obtaining the first location information of the first contactpoint, the electronic device obtains the first virtual key correspondingto the first contact point based on the first location information, andthen determines whether the first virtual key is an anchor point key.

In this embodiment of this application, the first virtual keycorresponding to the first contact point can be obtained in real timebased on the first location information. In this way, this solution iscompatible with both a virtual keyboard whose location is fixed and avirtual keyboard whose location is movable. This expands an applicationscenario of this solution.

It should be noted that meaning of the anchor point key is notequivalent to that of a positioning key, that is, the anchor point keymeans a key used to prompt a user. After a currently displayed virtualkeyboard is determined, a specific virtual key may be preconfigured asan anchor point key in the electronic device, in other words, a specificvirtual key may be predetermined as an anchor point key. Alternatively,a specific virtual key may be customized by the user as an anchor pointkey, that is, the user may define a specific virtual key as an anchorpoint key in a “setting” interface of the electronic device. Further, asame electronic device may provide a plurality of different types ofvirtual keys, and anchor point keys in the different types of virtualkeys may also be different.

For example, the anchor point key may be a key “F” and a key “J”, or theanchor point key may further include a space key. For another example,the anchor point key may further include common function keys such as anESC key, a Backspace key, an Enter key, and a Ctrl key, and number keys.For another example, the virtual keyboard uses a “DVORAK” layout mode,and the anchor point key may include eight standard finger location keys“AOEUHTNS”. For another example, the virtual keyboard adopts an “AZERTY”layout mode, and the anchor point keys may further include eight keys“QSDFJKLM”. For another example, the anchor point keys may furtherinclude six keys “AZERTY”, and the like. The anchor point keys are notexhaustively described herein.

906: The electronic device performs a first feedback operation.

In this embodiment of this application, if the contact operationcorresponding to the first contact point is a press operation, and thefirst virtual key is an anchor point key, the electronic device performsthe first feedback operation. The first feedback operation is used toprompt that the first virtual key is an anchor point key.

Specifically, in an embodiment, the first feedback operation may be in aform of vibration feedback. In this case, operation 906 may include: Theelectronic device obtains a first vibration feedback element from aplurality of vibration feedback elements, where the touchscreen isprovided with the first vibration feedback element, the first vibrationfeedback element is a vibration feedback element that matches the firstvirtual key, and vibration feedback elements that match differentvirtual keys are not completely the same; and emits a first type ofvibration wave by using the first vibration feedback element, to performthe first feedback operation. The vibration wave emitted by thevibration feedback element is a non-ultrasonic wave, and a frequency isusually less than or equal to 500 hertz.

More specifically, the following describes a process of obtaining thefirst vibration feedback element that matches the first virtual key.Before the electronic device is delivered from a factory, a location ofeach of the plurality of vibration feedback elements included in thetouchscreen is fixed. Therefore, a first mapping relationship may beconfigured before the electronic device is delivered from the factory.In an embodiment, the entire touchscreen may be divided into a pluralityof location regions, and the first mapping relationship stored in theelectronic device includes a correspondence between each of theplurality of location regions on the touchscreen and at least onevibration feedback element. Therefore, regardless of whether thelocation of the first type of virtual keyboard is fixed or can be movedin the process of displaying the first type of virtual keyboard, theelectronic device may obtain, based on the first location informationthat is obtained in operation 901 and the first mapping relationship, atleast one first vibration feedback element that matches the firstvirtual key (in other words, matches the first location information)from the plurality of vibration feedback elements. In this embodiment ofthis application, at least one first vibration feedback element thatmatches the first virtual key can be obtained based on the firstlocation information and the first mapping relationship. This isconvenient and helps improve efficiency of a matching process of thevibration feedback element. In addition, the first mapping relationshipcan indicate a correspondence between the first location information andone first vibration feedback element. In this way, this solution iscompatible with both a virtual keyboard whose location is fixed and avirtual keyboard whose location is movable. This ensures that vibrationfeedback can be provided in various scenarios.

In another embodiment, if the location of the first type of virtualkeyboard is fixed in the process of displaying the first type of virtualkeyboard, the electronic device may be preconfigured with a plurality ofmapping relationships that are in a one-to-one correspondence with aplurality of virtual keyboards. Each mapping relationship includes acorrespondence between each virtual key of the plurality of virtual keysand at least one vibration feedback element. Therefore, the electronicdevice first obtains, from the plurality of mapping relationships, afirst mapping relationship that matches a currently displayed virtualkeyboard. The first mapping relationship includes a correspondencebetween each virtual key on the currently displayed virtual keyboard andthe at least one first vibration feedback element. The electronic deviceobtains, based on the first mapping relationship and the first virtualkey determined in operation 903, one or more first vibration feedbackelements that match the first virtual key.

In this embodiment of this application, the first mapping relationshipis preconfigured, so that after the first virtual key is obtained, atleast one first vibration feedback element that matches the firstvirtual key can be obtained based on the first mapping relationship.This is convenient and helps improve efficiency of a matching process ofthe vibration feedback element. The operation of determining thevibration feedback element is split, so that when a fault occurs, afault location can be precisely located.

In another embodiment, the electronic device is preconfigured withlocation information of each vibration feedback element. The electronicdevice determines, based on first location information of the firstvirtual key and the location information of each vibration feedbackelement in the vibration feedback module, whether there is a vibrationfeedback element configured to generate a vibration wave below the firstvirtual key. If there is the vibration feedback element that isconfigured to generate the vibration wave below the first virtual key,the electronic device obtains at least one vibration feedback elementlocated below the first virtual key. The at least one vibration feedbackelement located below the first virtual key means a vibration feedbackelement whose location region intersects a projection of the firstvirtual key on the vibration feedback module. If there is no vibrationfeedback element that is configured to generate a vibration wave belowthe first virtual key, the electronic device searches, by using centralpoint coordinates of the first location information of the first virtualkey as a central point, for a vibration feedback element that isconfigured to generate a vibration wave and that is located in a presetregion. The preset region may be a circle, a square, a rectangle, or thelike. A size of the preset region may be determined with reference tofactors such as an arrangement layout of the vibration feedback elementand an element type used by the vibration feedback element. This is notlimited herein.

The following describes a process of emitting the vibration wave byusing the first vibration feedback element to perform the first feedbackoperation. Specifically, after the electronic device determines the atleast one first vibration feedback element that matches the virtual key,the electronic device emits a first type of vibration wave by using theat least one first vibration feedback element.

Optionally, the electronic device may further obtain, based on the firstlocation information of the first contact point, a location typecorresponding to the first contact point. The location type includesthat the first contact point is located in a first location region ofthe anchor point key and the first contact point is located in a secondlocation region of the anchor point key, where the first location regionis different from the second location region. That is, all locationregions of one anchor point key are further divided into the firstlocation region (which may also be referred to as a characteristicregion of the anchor point key) and the second location region (whichmay also be referred to as a side region of the anchor point key). Adivision manner of the first location region and the second locationregion in different virtual keys may be different.

For more intuitive understanding of this solution, refer to FIG. 11 toFIG. 13 . FIG. 11 to FIG. 13 show four schematic diagrams of a firstlocation region and a second location region in a feedback methodaccording to an embodiment of this application. FIG. 11 includes twoschematic subdiagrams (a) and (b). A region inside a dashed box in theschematic subdiagram (a) in FIG. 11 represents a first location regionof a virtual key K (which may also be a characteristic location regionof the key K), and a region outside the dashed box in the schematicsubdiagram (a) in FIG. 11 represents a second location region of thevirtual key K (which may also be a side location region of the key K). Aregion inside a dashed box in the schematic subdiagram (b) in FIG. 11represents a first location region of a virtual key J, and a regionoutside the dashed box in the schematic subdiagram (b) in FIG. 11represents a second location region of the virtual key J. The schematicsubdiagram (b) in FIG. 11 may show a division manner of a first locationregion and a second location region of a virtual key corresponding to abutton having a small bump in a physical keyboard.

Still refer to FIG. 12 . A region inside a dashed box in FIG. 12represents a first location region of a virtual key K, and a regionoutside the dashed box in FIG. 12 represents a second location region ofthe virtual key K. FIG. 12 and the schematic subdiagram (a) in FIG. 11show two different region division manners. A division manner in FIG. 12is to simulate a keycap having a concave arc surface in a physicalkeyboard. Refer to FIG. 13 . In FIG. 13 , the region inside the dashedbox of the virtual key K represents the first location region of thevirtual key K. In FIG. 13 , a region between two dashed boxes of thevirtual key K represents the second location region of the virtual keyK. FIG. 13 , FIG. 12 , and the schematic subdiagram (a) in FIG. 11 showdifferent region division manners. If the virtual key is an anchor pointkey, the second location region (which may also be referred to as theside location region of the virtual key) of the virtual key K isextended beyond a side of the virtual key K, and covers a key gap aroundthe virtual key K. This can further enhance a tactile difference degreeof the anchor point key. It should be understood that the divisionmanners of the first location region and the second location regionshown in FIG. 11 to FIG. 13 are only for ease of understanding ofconcepts of the first location region and the second location region. Inan actual case, the first location region and the second location regionmay be divided with reference to factors such as an actual applicationproduct form and a user habit. This is not limited herein.

The electronic device may determine, based on the location typecorresponding to the first contact point, a type of the vibration waveemitted by the first vibration feedback element. If the first contactpoint is located in the first location region of the anchor point key,and if the first contact point is located in the second location regionof the anchor point key, a type of a vibration wave emitted by theelectronic device by using the at least one first vibration feedbackelement may be different. If the electronic device emits a continuousvibration wave by using the vibration feedback element, different typesof vibration waves are different in any one or more of the followingcharacteristics: a vibration amplitude, a vibration frequency, vibrationduration, or a vibration waveform. If the electronic device emits avibration wave in a pulse form by using the vibration feedback element,different types of vibration waves are different in any one or more ofthe following characteristics: a vibration amplitude, a vibrationfrequency, vibration duration, a vibration waveform, or a frequency of avibration wave in a pulse form that is emitted by the electronic device.

Further, vibration waves with different vibration amplitudes may beimplemented by using different trigger voltages. A vibration amplitudeof a vibration wave generated when a 300 V voltage is input to thevibration feedback element is different from a vibration amplitude of avibration wave generated when a 400 V voltage is input to the vibrationfeedback element. A vibration frequency of the vibration wave emitted bythe vibration feedback element corresponding to the anchor point key maybe between 200 hertz and 400 hertz, for example, 240 hertz, 260 hertz,300 hertz, 350 hertz, 380 hertz, or another value, which is notexhaustively described herein. The vibration duration may be 10milliseconds, 15 milliseconds, 20 milliseconds, 25 milliseconds, 30milliseconds, or the like. The vibration wave emitted by the vibrationfeedback element corresponding to the anchor point key may be in asingle basic waveform, or may be a superposition of a plurality ofdifferent basic waveforms. The foregoing basic waveform includes but isnot limited to a square wave, a sine wave, a sawtooth wave, a triangularwave, another type of basic waveform, or the like. For example, avibration wave emitted by one first vibration feedback element may be asine wave that is generated by using a 350 V voltage (which determines avibration amplitude), whose vibration frequency is 290 hertz, and whoseduration is 20 milliseconds. It should be understood that the examplesherein are only for ease of understanding of this solution, and are notintended to limit this solution.

Optionally, at least one first vibration feedback element in thetouchscreen matches the first virtual key, and there is still a secondvirtual key on the virtual keyboard. A quantity of vibration feedbackelements of the second virtual key and a quantity of vibration feedbackelements corresponding to the first virtual key may be different or thesame, in other words, quantities of vibration feedback elementscorresponding to different virtual keys may be the same or different.For example, a quantity of vibration feedback elements corresponding tothe virtual key K may be 3, and a quantity of vibration feedbackelements corresponding to the virtual key J may be 2.

To ensure that a difference between a vibration feedback intensitycorresponding to the first virtual key and a vibration feedbackintensity corresponding to the second virtual key falls within a presetintensity range, in other words, to enable a difference between a totalvibration feedback intensity (namely, a vibration feedback intensitythat can be sensed by the user) corresponding to a different virtual keyto fall within the preset intensity range, the electronic device obtainsa vibration intensity of a vibration wave corresponding to each of theat least one first vibration feedback element. The vibration intensityof the vibration wave of each of the at least one first vibrationfeedback element is related to a first quantity. The first quantity is aquantity of the vibration feedback elements that match the first virtualkey. Further, the electronic device emits, based on the vibrationintensity of the vibration wave corresponding to each first vibrationfeedback element, a first type of vibration wave by using each of the atleast one first vibration feedback element. The preset intensity rangemay be an intensity difference within 2%, an intensity difference within3%, an intensity difference within 4%, an intensity difference within5%, another intensity range, or the like, which is not exhaustivelydescribed herein.

Specifically, in an embodiment, after determining the at least one firstvibration feedback element that matches the first virtual key, theelectronic device may directly determine, based on a quantity of firstvibration feedback elements that match the first virtual key, thevibration intensity of the vibration wave corresponding to each of theat least one first vibration feedback element. The electronic device maydetermine the vibration intensity of the vibration wave of each firstvibration feedback element based on any one or a combination of thefollowing factors: the quantity of the first vibration feedback elementsthat match the first virtual key, a distance between each firstvibration feedback unit and a central point of the first virtual key, atype of the vibration wave, whether the virtual key is an anchor pointkey, a location type of the first location information, another factor,or the like.

In another embodiment, the electronic device may prestore a secondmapping relationship. In one case, the second mapping relationshipindicates a relationship between a vibration intensity of each firstvibration feedback element corresponding to the first locationinformation, and then the electronic device may obtain the vibrationintensity of each first vibration feedback element based on the firstlocation information obtained in operation 901 and the second mappingrelationship. In another case, the second mapping relationship indicatesa relationship between the first virtual key and a vibration intensityof each first vibration feedback element, and then the electronic deviceobtains the vibration intensity of each first vibration feedback elementbased on the first virtual key obtained in operation 903 and the secondmapping relationship.

Further, in a process of measuring an intensity on a surface of thetouchscreen, a probe of a vibration measurement instrument may beattached to a surface of one virtual key (namely, a detection point) onthe touchscreen, to collect a vibration wave at the detection point andfurther obtain a waveform curve of the collected vibration wave. Thewaveform curve indicates a vibration feedback intensity corresponding tothe detection point. Further, the difference between the vibrationfeedback intensity corresponding to the first virtual key and thevibration feedback intensity corresponding to the second virtual key maybe obtained by comparing a waveform curve measured at a detection pointof the first virtual key and a waveform curve measured at a detectionpoint of the second virtual key.

In this embodiment of this application, different virtual keys maycorrespond to different quantities of vibration feedback elements.Therefore, the intensity of each vibration feedback element isdetermined based on a quantity of matched vibration feedback elements,so that a difference between vibration feedback intensities of thevirtual keys falls within a preset range. When the user uses a physicalkey, force feedbacks provided by different keys are basically the same.Therefore, a difference between the virtual keyboard and the physicalkeyboard can be reduced, and user viscosity is enhanced.

In another embodiment, the first feedback operation may be in a form ofsound feedback, and operation 907 may include: The electronic devicesends a first alert tone. The first alert tone may be a sound such as“beeping”, “buzzing”, or “humming”. A specific representation form ofthe first alert tone is not exhaustively described herein.

Optionally, the electronic device may further obtain, based on the firstlocation information of the first contact point, the location typecorresponding to the first contact point. If the first contact point islocated in the first location region of the anchor point key, and if thefirst contact point is located in the second location region of theanchor point key, the electronic device sends different alert tones. Forexample, if the first contact point is located in the first locationregion of the anchor point key, the electronic device sends a “beeping”alert tone; or if the first contact point is located in the secondlocation region of the anchor point key, the electronic device sends a“buzzing” alert tone.

The electronic device may further use another type of feedback mannerother than sound feedback and vibration feedback. A specific type offeedback manner to be used may be determined with reference to an actualproduct form and an actual application scenario of a product, and is notexhaustively described herein.

907: The electronic device performs a second feedback operation.

In some embodiments of this application, if the contact operationcorresponding to the first contact point is a press operation, and thefirst virtual key is not an anchor point key, the electronic device mayperform the second feedback operation. The second feedback operation isused to prompt that the first virtual key is a non-anchor point key, andthe first feedback operation and the second feedback operation aredifferent feedback operations. In this embodiment of this application,feedback operations are performed in both cases in which the firstvirtual key is an anchor point key or the first virtual key is anon-anchor point key. The first feedback operation and the secondfeedback operation are different feedback operations. When the user usesthe physical keyboard, each key provides feedback for the user. In theforegoing manner, a similarity between the virtual keyboard and thephysical keyboard can be increased. In addition, different feedbackoperations are provided for the anchor point key and the non-anchorpoint key. This can also help the user remember different types of keys,and help the user implement touch typing on the virtual keyboard.

In an embodiment, the second feedback operation may be in a form ofvibration feedback. In this case, operation 907 may include: Theelectronic device obtains the first vibration feedback element thatmatches the first virtual key, where the touchscreen is provided withthe first vibration feedback element; and emits a second type ofvibration wave by using the first vibration feedback element, to performthe second feedback operation. A difference between the first type ofvibration wave and the second type of vibration wave includes any one ormore of the following characteristics: a vibration amplitude, avibration frequency, vibration duration, and a vibration waveform. Thisembodiment of this application provides a specific manner ofdistinguishing different types of vibration waves. Different types ofvibration waves may be distinguished based on the vibration amplitude,the vibration frequency, the vibration duration, the vibration waveform,and/or the like. This improves embodiment flexibility of this solution.

Specifically, for a specific embodiment of obtaining, by the electronicdevice, the first vibration feedback element that matches the firstvirtual key, refer to the description in operation 906. Details are notdescribed herein again.

The following describes a process of emitting the vibration wave byusing the first vibration feedback element to perform the secondfeedback operation. Specifically, after the electronic device determinesthe at least one first vibration feedback element that matches thevirtual key, the electronic device emits a second type of vibration waveby using the at least one first vibration feedback element.

Optionally, if the first virtual key is not an anchor point key, theelectronic device may also obtain, based on the first locationinformation of the first contact point, the location type correspondingto the first contact point. The location type includes that the firstcontact point is located in a first location region of the non-anchorpoint key and the first contact point is located in a second locationregion of the non-anchor point key, where the first location region isdifferent from the second location region. That is, all location regionsof one non-anchor point key are further divided into the first locationregion (which may also be referred to as a characteristic region of theanchor point key) and the second location region (which may also bereferred to as a side region of the non-anchor point key). A divisionmanner of the first location region and the second location region indifferent virtual keys may be different.

The electronic device may determine, based on the location typecorresponding to the first contact point, a type of the vibration waveemitted by the first vibration feedback element. If the first contactpoint is located in the first location region of the non-anchor pointkey, and if the first contact point is located in the second locationregion of the non-anchor point key, a type of a vibration wave emittedby the electronic device by using the at least one first vibrationfeedback element may be different.

Further, in one case, a type of a vibration wave corresponding to thefirst location region of the anchor point key is the same as a type of avibration wave corresponding to the first location region of thenon-anchor point key, and a type of a vibration wave corresponding tothe second location region of the anchor point key is different from atype of a vibration wave corresponding to the second location region ofthe non-anchor point key.

In another case, a type of a vibration wave corresponding to the firstlocation region of the anchor point key is different from a type of avibration wave corresponding to the first location region of thenon-anchor point key, and a type of a vibration wave corresponding tothe second location region of the anchor point key is the same as a typeof a vibration wave corresponding to the second location region of thenon-anchor point key.

In another case, a type of a vibration wave corresponding to the firstlocation region of the anchor point key is different from a type of avibration wave corresponding to the first location region of thenon-anchor point key, and a type of a vibration wave corresponding tothe second location region of the anchor point key is different from atype of a vibration wave corresponding to the second location region ofthe non-anchor point key.

In this embodiment of this application, all location regions of theanchor point key and/or the non-anchor point key are divided into thefirst location region and the second location region. If the firstcontact point is located in the first location region, and if the firstcontact point is located in the second location region, the electronicdevice emits different types of vibration waves by using at least onefirst vibration feedback element. This helps the user remember aboundary of the virtual key, in other words, helps the user establish amuscle memory for different regions of the virtual key, to furtherreduce difficulty in implementing touch typing on the touchscreen.

In another embodiment, the second feedback operation may be in a form ofsound feedback, and operation 907 may include: The electronic devicesends a second alert tone. The second alert tone and the first alerttone are different alert tones.

Optionally, the electronic device may further obtain, based on the firstlocation information of the first contact point, the location typecorresponding to the first contact point. If the first contact point islocated in the first location region of the non-anchor point key, and ifthe first contact point is located in the second location region of thenon-anchor point key, the electronic device sends different prompttones.

It should be noted that operation 907 is an optional operation, andoperation 907 may not be performed. In other words, if the electronicdevice determines that the first virtual key is not an anchor point key,feedback may not be performed.

908: The electronic device determines whether the first virtual key isan anchor point key. If the first virtual key is an anchor point key,operation 909 is performed; or if the first virtual key is not an anchorpoint key, operation 910 is performed.

In this embodiment of this application, for a specific embodiment ofoperation 908, refer to the foregoing description of operation 905.Details are not described herein again.

909: The electronic device changes the tactile characteristic of thefirst contact point on the touchscreen, to present a first tactilestate.

In some embodiments of this application, if the contact operationcorresponding to the first contact point is a press operation, and thefirst virtual key is an anchor point key, the electronic device changesthe tactile characteristic of the first contact point on a cover of thetouchscreen, to present the first tactile state. The tactilecharacteristic of the cover of the touchscreen includes any one or moreof the following characteristics: a sliding friction coefficient, astick slip property, a temperature, another type of tactilecharacteristic, and the like. The electronic device may change thetactile characteristic of the entire cover of the touchscreen to thefirst tactile state, to change the first contact point on the cover ofthe touchscreen to the first tactile state. Alternatively, theelectronic device may change only the first contact point on the coverof the touchscreen to the first tactile state, without changing atactile state of another region in the cover of the touchscreen.

Specifically, in an embodiment, if an ultrasonic module is integratedinto the touchscreen of the electronic device, the electronic devicechanges the tactile characteristic of the first contact point on thecover of the touchscreen by emitting an ultrasonic wave by using theultrasonic module on the touchscreen. In this case, the electronicdevice may emit different types of ultrasonic waves by using theultrasonic module, so that the first contact point on the cover of thetouchscreen presents different tactile characteristics. If theelectronic device emits a single ultrasonic wave by using the ultrasonicmodule, different types of ultrasonic waves are different in any one ormore of the following characteristics: a vibration amplitude, avibration frequency, vibration duration, or a vibration waveform.Further, a frequency of the ultrasonic wave emitted by the ultrasonicmodule is greater than 20 kHz, and may be specifically 21 kHz, 22 kHz,24 kHz, 25 kHz, another value, or the like. This is not limited herein.If the electronic device emits a pulse wave by using the ultrasonicmodule, different types of ultrasonic waves are different in any one ormore of the following characteristics: a vibration amplitude, avibration frequency, vibration duration, a vibration waveform, or afrequency at which the electronic device emits the pulse wave. Thefrequency at which the electronic device emits the pulse wave may alsobe referred to as a rhythm at which the electronic device emits thepulse wave. For example, the electronic device emits one ultrasonic wavein a pulse form at an interval of 3 milliseconds by using the ultrasonicmodule, and the electronic device emits an ultrasonic wave in a pulseform at an interval of 10 milliseconds by using the ultrasonic module.In the foregoing two cases, each frequency at which the electronicdevice emits the pulse wave is different. It should be understood thatthe examples herein are only for ease of understanding of this solution,and are not intended to limit this solution.

Therefore, operation 909 may include: The electronic device obtains athird type of ultrasonic wave corresponding to the anchor point key, andemits the third type of ultrasonic wave by using the ultrasonic moduleon the touchscreen, to change the tactile characteristic of the firstcontact point on the touchscreen to the first tactile state.

Optionally, if the contact operation corresponding to the first contactpoint is a press operation, and the first virtual key is an anchor pointkey, the electronic device may further obtain, based on the firstlocation information of the first contact point, the location typecorresponding to the first contact point. The electronic device mayfurther determine, based on the location type corresponding to the firstcontact point, a type of an ultrasonic wave corresponding to the firstlocation information, and further emit the foregoing type of ultrasonicwave by using the ultrasonic module on the touchscreen. If the firstcontact point is located in the first location region of the anchorpoint key, and if the first contact point is located in the secondlocation region of the anchor point key, a type of the ultrasonic waveemitted by the electronic device by using the ultrasonic module may bedifferent.

In another embodiment, if an electrostatic module is integrated into thetouchscreen of the electronic device, the electronic device changes thetactile characteristic of the first contact point on the cover of thetouchscreen by emitting static electricity by using the electrostaticmodule on the touchscreen. In this case, the electronic device may emitstatic electricity of different magnitudes by using the electrostaticmodule, so that the first contact point on the cover of the touchscreenpresents different tactile characteristics. A volt value of staticelectricity emitted by the electrostatic module may range from 100 voltsto 400 volts. For example, a volt value of static electricity emitted bythe electrostatic module is 120 volts, 200 volts, 380 volts, or anothervalue. This is not limited herein.

Therefore, operation 909 may include: The electronic device obtains afirst volt value of static electricity corresponding to the anchor pointkey, and emits the static electricity of the first volt value by usingthe electrostatic module on the touchscreen, to change the tactilecharacteristic of the first contact point on the touchscreen to thefirst tactile state.

Optionally, if the contact operation corresponding to the first contactpoint is a press operation, and the first virtual key is an anchor pointkey, the electronic device may further obtain, based on the firstlocation information of the first contact point, the location typecorresponding to the first contact point. The electronic devicedetermines, based on the location type corresponding to the firstcontact point, a volt value of a current corresponding to the firstlocation information, and further emits the current of the volt value byusing a current module on the touchscreen. If the first contact point islocated in the first location region of the anchor point key, and if thefirst contact point is located in the second location region of theanchor point key, a volt value of the current emitted by the electronicdevice through the current module may be different.

It should be noted that the electronic device may further change thetactile characteristic of the cover on the touchscreen in anothermanner, which is not described one by one herein.

910: The electronic device changes the tactile characteristic of thefirst contact point on the touchscreen, to present a second tactilestate.

In some embodiments of this application, if the contact operationcorresponding to the first contact point is a press operation, and thefirst virtual key is a non-anchor point key, the electronic devicechanges the tactile characteristic of the first contact point on thecover of the touchscreen, to present the second tactile state. A tactilecharacteristic when the touchscreen presents the first tactile state maybe different from a tactile characteristic when the touchscreen presentsthe second tactile state, in other words, a feeling of touching theanchor point key by the user may be different from a feeling of touchingthe non-anchor point key by the user. This can further assist the userin distinguishing the anchor point key and the non-anchor point key onthe virtual keyboard, and further assist the user in locating thevirtual key on the virtual keyboard.

Specifically, in an embodiment, if an ultrasonic module is integratedinto the touchscreen of the electronic device, the electronic devicechanges the tactile characteristic of the first contact point on thecover of the touchscreen by emitting an ultrasonic wave by using theultrasonic module on the touchscreen. Therefore, operation 910 mayinclude: The electronic device obtains a fourth type of ultrasonic wavecorresponding to the non-anchor point key, and emits the fourth type ofultrasonic wave by using the ultrasonic module on the touchscreen, tochange the tactile characteristic of the first contact point on thetouchscreen to the second tactile state.

Optionally, if the contact operation corresponding to the first contactpoint is a press operation, and the first virtual key is a non-anchorpoint key, the electronic device may further obtain the location typecorresponding to the first contact point. The electronic devicedetermines, based on the location type corresponding to the firstcontact point, the type of the ultrasonic wave corresponding to thefirst location information. If the first contact point is located in thefirst location region of the non-anchor point key, and if the firstcontact point is located in the second location region of the non-anchorpoint key, a type of the ultrasonic wave emitted by the electronicdevice by using the ultrasonic module may be different.

In another embodiment, if an electrostatic module is integrated into thetouchscreen of the electronic device, the electronic device changes thetactile characteristic of the first contact point on the cover of thetouchscreen by emitting static electricity by using the electrostaticmodule on the touchscreen. Therefore, operation 909 may include: Theelectronic device obtains a second volt value of static electricitycorresponding to the anchor point key, and emits the static electricityof the second volt value by using the electrostatic module on thetouchscreen, to change the tactile characteristic of the first contactpoint on the touchscreen to the second tactile state.

Optionally, if the contact operation corresponding to the first contactpoint is a press operation, and the first virtual key is an anchor pointkey, the electronic device may further obtain the location typecorresponding to the first contact point. The electronic devicedetermines, based on the location type corresponding to the firstcontact point, the volt value of the current corresponding to the firstlocation information. If the first contact point is located in the firstlocation region of the non-anchor point key, and if the first contactpoint is located in the second location region of the non-anchor pointkey, a volt value of the current emitted by the electronic devicethrough the current module may be different.

It should be noted that operation 908 is an optional operation. Ifoperation 908 is not performed, operations 909 and 910 may be combined.In other words, if the contact operation corresponding to the firstcontact point is a touch operation, regardless of whether the firstvirtual key is an anchor point key or a non-anchor point key, thetactile characteristic of the first contact point on the touchscreen maypresent a same tactile state.

In addition, operations 908 to 910 are all optional operations. Afterdetermining that the contact operation corresponding to the firstcontact point is not a press operation, the electronic device may notdirectly perform feedback. In other words, if the pressure valuecorresponding to the first contact point is less than the first pressurevalue threshold, the electronic device may not perform feedback.

In this embodiment of this application, when the user touches an anchorpoint key in the virtual key, the user performs a first feedbackoperation by using the touchscreen, to prompt the user that the user iscurrently touching an anchor point key, so that the user can sense alocation of the anchor point key. This can reduce difficulty inimplementing touch typing on the touchscreen. In addition, thetouchscreen is provided with a plurality of vibration feedback elements.If the first virtual key is determined as an anchor point key, at leastone first vibration feedback element that matches the first virtual keyis obtained from the plurality of vibration feedback elements. The atleast one first vibration feedback is indicated to emit a vibrationwave. This can generate vibration feedback effect only around the firstvirtual key, in other words, vibration feedback is not performed on afull screen. All fingers are placed on the touchscreen during typing. Ifthe full screen vibrates, all fingers feel vibration. The user is likelyto be confused. However, if the vibration feedback effect is generatedonly around the first virtual key, the user is not likely to beconfused. It is easier to help the user form a muscle memory at thefinger, to assist the user in implementing touch typing on thetouchscreen.

According to the embodiments corresponding to FIG. 1 to FIG. 13 , tobetter implement the foregoing solutions in embodiments of thisapplication, the following further provides a related device used toimplement the foregoing solutions. FIG. 14 is a schematic diagram of astructure of an electronic device according to an embodiment of thisapplication. The electronic device 1 includes a touchscreen 20, a memory40, one or more processors 10, and one or more programs 401. Thetouchscreen 20 is provided with a plurality of vibration feedbackelements. The one or more programs 401 are stored in the memory 40. Whenthe one or more processors 10 execute the one or more programs 401, theelectronic device is enabled to perform the following operations:detecting a first contact operation acting on the touchscreen 20;obtaining, in response to the first contact operation, first locationinformation of a first contact point corresponding to the first contactoperation, where the first location information corresponds to a firstvirtual key on the virtual keyboard; if the first virtual key is ananchor point key, obtaining a first vibration feedback element from theplurality of vibration feedback elements, where the first vibrationfeedback element is a vibration feedback element that matches the firstvirtual key; and indicating the first vibration feedback element to emita vibration wave, to perform a first feedback operation, where the firstfeedback operation is used to prompt that the first virtual key is ananchor point key.

In a possible design, the electronic device 1 is provided with a firstmapping relationship. The first mapping relationship indicates acorrespondence between virtual keys and vibration feedback elements.When the one or more processors 10 execute the one or more programs 401,the electronic device 1 is enabled to specifically perform the followingoperation: obtaining the first vibration feedback element based on thefirst mapping relationship and the first virtual key.

In a possible design, the electronic device 1 is provided with a firstmapping relationship. The first mapping relationship indicates acorrespondence between the location information and the vibrationfeedback element. When the one or more processors 10 execute the one ormore programs 401, the electronic device 1 is enabled to specificallyperform the following operation: obtaining the first vibration feedbackelement based on the first mapping relationship and the first locationinformation.

In a possible design, when the one or more processors 10 execute the oneor more programs 401, the electronic device 1 is enabled to furtherperform the following operation: obtaining a vibration intensity of avibration wave corresponding to each of at least one first vibrationfeedback element. The vibration intensity of the vibration wave of eachof the at least one first vibration feedback element is related to afirst quantity. The first quantity is a quantity of the first vibrationfeedback elements. When the one or more processors 10 execute the one ormore programs 401, the electronic device 1 is enabled to specificallyperform the following operation: emitting, based on the vibrationintensity of the vibration wave corresponding to each first vibrationfeedback element, the vibration wave by using the at least one firstvibration feedback element, so that a difference between a vibrationfeedback intensity corresponding to the first virtual key and avibration feedback intensity corresponding to a second virtual key fallswithin a preset intensity range. The second virtual key and the firstvirtual key are different virtual keys.

In a possible design, the first vibration feedback element is any onetype of the following: a piezoelectric ceramic sheet, a linear motor, ora piezoelectric film.

In a possible design, when the one or more processors 10 execute the oneor more programs 401, the electronic device 1 is enabled to furtherperform the following operation: obtaining, based on the first locationinformation, a location type corresponding to the first contact point.The location type includes that the first contact point is located in afirst location region of the first virtual key and the first contactpoint is located in a second location region of the first virtual key.The first location region is different from the second location region.When the one or more processors 10 execute the one or more programs 401,the electronic device 1 is enabled to specifically perform the followingoperation: performing the first feedback operation by using thetouchscreen 20 based on the location type corresponding to the firstcontact point. A feedback operation corresponding to the first locationregion is different from a feedback operation corresponding to thesecond location region.

In a possible design, when the one or more processors 10 execute the oneor more programs 401, the electronic device 1 is enabled to furtherperform the following operations: selecting, in response to a detectedfirst gesture operation, a first type of virtual keyboard correspondingto the first gesture operation from a plurality of types of virtualkeyboards, where virtual keys included in different types of virtualkeyboards in the plurality of types of virtual keyboards are notcompletely the same; and displaying the first type of virtual keyboardby using the touchscreen 20. A location of the first type of virtualkeyboard on the touchscreen 20 is fixed in the process of displaying thefirst type of virtual keyboard. When the one or more processors 10execute the one or more programs 401, the electronic device 1 is enabledto specifically perform the following operation: detecting the firstcontact operation acting on the touchscreen 20 in the process ofdisplaying the first type of virtual keyboard.

It should be noted that content such as information exchange and anexecution process between the modules/elements in the electronic device1 is based on a same concept as the method embodiments corresponding toFIG. 9 to FIG. 13 in this application. For specific content, refer tothe descriptions in the foregoing method embodiments in thisapplication. Details are not described herein again.

An embodiment of this application further provides an electronic device.FIG. 15 is a schematic diagram of a structure of an electronic deviceaccording to an embodiment of this application. The electronic device 1may be specifically represented as a mobile phone, a tablet computer, anotebook computer, another device provided with a touchscreen, or thelike. This is not limited herein. The electronic device described in theembodiments corresponding to FIG. 1 to FIG. 8 may be deployed on theelectronic device 1, and is configured to implement a function of theelectronic device in the embodiments corresponding to FIG. 9 to FIG. 13. Specifically, the electronic device 1 may vary greatly with aconfiguration or performance, and may include one or more centralprocessing units (CPU) 1522 (for example, one or more processors), amemory 40, and one or more storage media 1530 (for example, one or moremass storage devices) that store an application 1542 or data 1544. Thememory 40 and the storage medium 1530 may be for temporary storage orpermanent storage. The program stored in the storage medium 1530 mayinclude one or more modules (which are not shown in the figure), andeach module may include a series of instruction operations on theelectronic device. Further, the central processing unit 1522 may beconfigured to communicate with the storage medium 1530, and perform, onthe electronic device 1, the series of instruction operations in thestorage medium 1530.

The electronic device 1 may further include one or more power supplies1526, one or more wired or wireless network interfaces 1550, one or moreinput/output interfaces 1558, and/or one or more operating systems 1541,for example, Windows Server™, Mac OS X™, Unix™, Linux™, and FreeBSD™.

In this embodiment of this application, the central processing unit 1522is configured to implement a function of the electronic device in theembodiments corresponding to FIG. 9 to FIG. 13 . It should be notedthat, for a specific embodiment in which the central processing unit1522 performs the function of the electronic device in the embodimentscorresponding to FIG. 9 to FIG. 13 and a beneficial effect of thefunction, refer to the descriptions in the method embodimentscorresponding to FIG. 9 to FIG. 13 . Details are not described hereinagain.

An embodiment of this application further provides a computer-readablestorage medium. The computer-readable storage medium stores a computerprogram. When the program is run on a computer, the computer is enabledto perform the operations performed by the electronic device in themethod described in the embodiments shown in FIG. 9 to FIG. 13 .

An embodiment of this application further provides a computer program.When the computer program is run on a computer, the computer is enabledto perform the operations performed by the electronic device in themethod described in the embodiments shown in FIG. 9 to FIG. 13 .

An embodiment of this application further provides a circuit system. Thecircuit system includes a processing circuit, and the processing circuitis configured to perform the operations performed by the electronicdevice in the method described in the embodiments shown in FIG. 9 toFIG. 13 .

The electronic device provided in this embodiment of this applicationmay be specifically a chip. The chip includes a processing unit and acommunication unit. The processing unit may be, for example, aprocessor. The communication unit may be, for example, an input/outputinterface, a pin, or a circuit. The processing unit may execute computerexecutable instructions stored in a storage unit, so that the chipperforms the operations performed by the electronic device in the methoddescribed in the embodiments shown in FIG. 9 to FIG. 13 . Optionally,the storage unit is a storage unit in the chip, for example, a registeror a cache; or the storage unit may be a storage unit that is in a radioaccess device and that is located outside the chip, for example, aread-only memory (ROM), another type of static storage device that canstore static information and instructions, or a random access memory(RAM).

The processor mentioned anywhere above may be a general-purpose centralprocessing unit, a microprocessor, an application-specific integratedcircuit (ASIC), or one or more integrated circuits that are configuredto control program execution of the method according to the firstaspect.

In addition, it should be noted that the described apparatus embodimentsare only examples. The units described as separate parts may or may notbe physically separate, and parts displayed as units may or may not bephysical units, may be located in one location, or may be distributed ona plurality of network units. Some or all of the modules may be selectedbased on actual requirements to achieve the objectives of the solutionsin embodiments. In addition, in the accompanying drawings of theapparatus embodiments provided by this application, connectionrelationships between modules indicate that the modules havecommunication connections with each other, which may be specificallyimplemented as one or more communication buses or signal cables.

Based on the description of the foregoing embodiments, a person skilledin the art may clearly understand that this application may beimplemented by software in addition to necessary universal hardware, orcertainly may be implemented by dedicated hardware, including adedicated integrated circuit, a dedicated CLU, a dedicated memory, adedicated component, and the like. Usually, any function implemented bya computer program may be easily implemented by using correspondinghardware. In addition, specific hardware structures used to implement asame function may be various, for example, an analog circuit, a digitalcircuit, or a dedicated circuit. However, in this application, asoftware program embodiment is a better embodiment in most cases. Basedon such an understanding, the technical solutions of this applicationessentially or the part contributing to the conventional technology maybe implemented in a form of a software product. The computer softwareproduct is stored in a readable storage medium, such as a floppy disk, auniversal serial bus (USB) flash drive, a removable hard disk, a ROM, aRAM, a magnetic disk, or an optical disc of a computer, and includesseveral instructions for instructing a computer device (which may be apersonal computer, a server, or a network device) to perform the methodsdescribed in embodiments of this application.

All or some of the foregoing embodiments may be implemented by software,hardware, firmware, or any combination thereof. When software is used toimplement the foregoing embodiments, all or some of the embodiments maybe implemented in a form of a computer program.

The computer program includes one or more computer instructions. Whenthe computer program instructions are loaded and executed on a computer,the procedures or functions according to embodiments of this applicationare all or partially generated. The computer may be a general-purposecomputer, a dedicated computer, a computer network, or anotherprogrammable apparatus. The computer instructions may be stored in acomputer-readable storage medium or may be transmitted from acomputer-readable storage medium to another computer-readable storagemedium. For example, the computer instructions may be transmitted from awebsite, computer, server, or data center to another website, computer,server, or data center in a wired (for example, a coaxial cable, anoptical fiber, or a digital subscriber line (DSL)) or wireless (forexample, infrared, radio, or microwave) manner. The computer-readablestorage medium may be any usable medium accessible to a computer, or adata storage device integrating one or more usable media, for example, aserver or a data center. The usable medium may be a magnetic medium (forexample, a floppy disk, a hard disk, or a magnetic tape), an opticalmedium (for example, a DVD), a semiconductor medium (for example, asolid state drive (SSD)), or the like.

Embodiment 2

This embodiment of this application may be applied to variousapplication scenarios in which input is performed by using a virtualkeyboard. For example, in an application for editing text, content suchas text, a number, and a character is to be input by using the virtualkeyboard. For another example, in an application for producing a powerpoint (PPT), content such as text, a number, and a character is also tobe input by using the virtual keyboard. For still another example, in agame application, a function such as moving a virtual character,changing a character name, and performing instant messaging with a gamefriend may also be performed by using the virtual keyboard. It should beunderstood that this embodiment of this application may be furtherapplied to another application scenario in which input is performed byusing the virtual keyboard, which is not exhaustively described herein.In the foregoing various scenarios, there is a problem that a quantityof keys of a virtual keyboard is limited, and an additional physicalkeyboard needs to be provided to meet an input requirement of a user.

To resolve the foregoing problem, this embodiment of this applicationprovides a virtual keyboard processing method. The method is applied toan electronic device shown in FIG. 16 . The electronic device isprovided with a plurality of types of virtual keyboards. The user canenable different types of virtual keyboards through different gestureoperations. In other words, the virtual keyboard no longer displays only26 letters, but provides more virtual keys for the user by using thedifferent types of virtual keyboards. This improves flexibility of aprocess in which the user enables the virtual keyboard, and helpsprovide more abundant virtual keys, so that an additional physicalkeyboard does not need to be provided.

FIG. 16 is a schematic diagram of an electronic device according to anembodiment of this application. In some application scenarios, as shownin FIG. 2 , the electronic device 1 includes at least one display, andthe display is one touchscreen (namely, the touchscreen 20 in FIG. 2 ).In this case, the electronic device 1 may obtain, by using the display,various types of gesture operations input by a user, and display varioustypes of virtual keyboards by using the display.

In some other application scenarios, as shown in FIG. 16 , theelectronic device 2 may be represented as a virtual reality device suchas a VR, an AR, or an MR. The electronic device 2 collects various typesof gesture operations of a user by using a camera configured on a headmounted display device, and displays various types of virtual keyboardsto the user by using the head mounted display device.

With reference to the foregoing descriptions, FIG. 17 is a schematicflowchart of a virtual keyboard processing method according to anembodiment of this application. The virtual keyboard processing methodprovided in this embodiment of this application may include thefollowing operations.

1701: The electronic device detects a first gesture operation, andobtains a first gesture parameter corresponding to the first gestureoperation.

In this embodiment of this application, the electronic device may detectin real time whether a user inputs a gesture operation, and whendetecting the first gesture operation input by the user, the electronicdevice generates the first gesture parameter corresponding to the firstgesture operation. Specifically, in some application scenarios, theelectronic device is provided with a touchscreen, and the electronicdevice obtains, in real time by using the touchscreen, the first gestureoperation input by the user. In some other application scenarios, theelectronic device may collect, by using a camera configured on a headmounted display device, the first gesture operation input by the user,to generate the first gesture parameter corresponding to the firstgesture operation. In this application scenario, the electronic devicemay be represented as a virtual reality device such as a VR, an AR, oran MR. This is not limited herein.

If the first gesture operation is obtained by using a display configuredon the electronic device, the first gesture parameter includes any oneor more of the following parameters: location information of a contactpoint corresponding to the first gesture operation, quantity informationof the contact point corresponding to the first gesture operation, areainformation of the contact point corresponding to the first gestureoperation, another type of parameter information, or the like. Thisembodiment of this application describes specific information includedin the first gesture parameter. The first gesture parameter includeslocation information of each contact point and quantity information of aplurality of contact points, and also includes area information of eachcontact point. The area information of the contact point can distinguisha contact point triggered based on a palm from the plurality of contactpoints. This helps accurately estimate a type of the first gestureoperation, avoids displaying an incorrect virtual keyboard, and improvesaccuracy of a display process of the virtual keyboard.

Further, the location information of the contact point corresponding tothe first gesture operation may be represented by using coordinateinformation, a function, or other information. An origin of a coordinatesystem corresponding to the location information may be a central pointof the display, an upper left corner vertex of the display, a lower leftcorner vertex of the display, an upper right corner vertex of thedisplay, a lower right corner vertex of the display, another locationpoint, or the like. The origin of the coordinate system may bespecifically determined based on an actual application scenario.

Specifically, the display of the electronic device may be a touchscreen,and the touchscreen may be provided with a tactile sensing module. Theelectronic device collects, by using the tactile sensing moduleconfigured on the display, the first gesture parameter corresponding tothe first gesture operation. For more intuitive understanding of thissolution, refer to FIG. 18 . FIG. 18 is a schematic diagram of the firstgesture parameter in the virtual keyboard processing method according toan embodiment of this application. FIG. 18 uses an example in which thefirst gesture operation is a one-hand operation. As shown in the figure,four contact points may be obtained on the display, areas of three ofthe four contact points generated by fingers are small, and an area of aremaining contact point generated by a palm is large. It should beunderstood that the example in FIG. 18 is only for ease of understandingof this solution, and is not intended to limit this solution.

If an electronic device is a virtual reality device, the virtualkeyboard may be visually presented in stereoscopic space. The electronicdevice may detect a gesture operation in space in real time, to obtain,when the first gesture operation is detected, the first gestureparameter corresponding to the first gesture operation.

Specifically, in one case, the electronic device may track a hand of auser in real time by using a handheld device or a hand wearable deviceof the user, to monitor the first gesture operation of the user. Inanother case, the electronic device includes a head mounted displaydevice, and obtains the first gesture operation by using a cameraconfigured on the head mounted display device. The first gestureparameter may be specifically represented as an image corresponding tothe first gesture operation. The electronic device may input the imagecorresponding to the first gesture operation into a neural network usedfor image recognition, to generate the first gesture parametercorresponding to the first gesture operation.

1702: The electronic device generates first indication information basedon the first gesture parameter information.

In this embodiment of this application, after collecting the firstgesture parameter corresponding to the first gesture operation, theelectronic device may further perform secondary processing based on theobtained first gesture parameter, to generate the first indicationinformation corresponding to the first gesture parameter. The firstindication information may also be considered as a gesture parameterobtained through secondary processing. The first indication informationincludes any one or more of the following (in other words, the firstgesture parameter indicates any one or more of the following): relativeangle information of a hand corresponding to the first gestureoperation, location information of the hand corresponding to the firstgesture operation, quantity information of the hand corresponding to thefirst gesture operation, shape information of the hand corresponding tothe first gesture operation, and the like. A specific type ofinformation that may be included in the first indication information maybe flexibly set with reference to an actual application scenario, and isnot limited herein. In this embodiment of this application, aftersecondary processing is performed on the obtained first gestureparameter, information such as the relative angle information of thehand, the location information of the hand, the quantity information ofthe hand, or the shape information of the hand may be obtained. In otherwords, more abundant information about the first gesture operation maybe obtained based on the first gesture parameter. This increasesflexibility of a matching process of the virtual keyboard.

Specifically, in some application scenarios, the first gesture parameteris collected by using the display of the electronic device. Then therelative angle information of the hand corresponding to the firstgesture operation may include any one or more of the following: arelative angle between the hand corresponding to the first gestureoperation and any side of the display, a relative angle between the handcorresponding to the first gesture operation and a center line of thedisplay, a relative angle between the hand corresponding to the firstgesture operation and a diagonal line of the display, and the like. Thisis not limited herein.

More specifically, if the electronic device determines that the firstgesture operation is a one-hand operation (that is, a quantity of handscorresponding to the first gesture operation is 1), the electronicdevice obtains at least two first contact points (namely, contact pointsgenerated by fingers) from a plurality of contact points correspondingto the first gesture operation, and connects the at least two firstcontact points, or connects two first contact points that are farthestfrom each other in the at least two first contact points. Then, theelectronic device generates a straight line corresponding to the firstgesture operation, and further calculates a relative angle between thestraight line and a preset line. The preset line includes any one ormore of the following: any side of the display, the center line of thedisplay, the diagonal line of the display, and the like. In this case,the electronic device obtains the relative angle information of the handcorresponding to the first gesture operation.

If the electronic device determines that the first gesture operation isa two-hand operation (that is, a quantity of hands corresponding to thefirst gesture operation is 2), the electronic device obtains at leasttwo first contact points from a plurality of contact pointscorresponding to the first gesture operation, and connects at least twofirst contact points corresponding to a left hand, or connects two firstcontact points that are farthest from each other in the at least twofirst contact points corresponding to the left hand. Then, theelectronic device generates a first straight line corresponding to theleft hand. The electronic device connects at least two first contactpoints corresponding to a right hand, or connects two first contactpoints that are farthest from each other in the at least two firstcontact points corresponding to the right hand. Then, the electronicdevice generates a second straight line corresponding to the right hand.Further, the electronic device separately calculates a first sub-anglebetween the first straight line and a preset line, and calculates asecond sub-angle between the second straight line and the preset line,to obtain the relative angle information of the hand corresponding tothe first gesture operation.

For more intuitive understanding of this solution, refer to FIG. 19 .FIG. 19 is a schematic diagram of the relative angle information in thevirtual keyboard processing method according to an embodiment of thisapplication. FIG. 19 uses an example in which the first gestureoperation is a two-hand operation. FIG. 19 includes two schematicsubdiagrams (a) and (b). The schematic subdiagram (a) in FIG. 19 showslocations of contact points corresponding to the two-hand operation. Theschematic subdiagram (b) in FIG. 19 shows an example in which the presetline is a bottom side of the display. Two contact points that arefarthest from each other in four contact points corresponding to theleft hand are connected to generate the first straight line, and twocontact points that are farthest from each other in four contact pointscorresponding to the right hand are connected to generate the secondstraight line, to obtain the first sub-angle and the second sub-angle.It should be understood that the example in FIG. 19 is only for ease ofunderstanding of this solution, and is not intended to limit thissolution.

The following describes a process of determining location information ofthe hand. The electronic device first determines, based on the obtainedfirst gesture parameter, the quantity of hands corresponding to thefirst gesture operation. If the first gesture operation is a two-handoperation, a hand location corresponding to the first gesture operationincludes a distance between the two hands; or if the first gestureoperation is a one-hand operation, a hand location corresponding to thefirst gesture operation includes a first region and a fourth region. Thefirst region is located in a lower left corner or a lower right cornerof the display, and the fourth region is a region other than the firstregion on the display panel. Further, a width of the first region may bea value such as 3 centimeters, 4 centimeters, or 5 centimeters. A bottomside of the first region coincides with a bottom side of the display.For more intuitive understanding of this solution, refer to FIG. 20 .FIG. 20 shows two schematic diagrams of the first region in the virtualkeyboard processing method according to an embodiment of thisapplication. A schematic subdiagram (a) and a schematic subdiagram (b)in FIG. 20 separately show two schematic diagrams of the first region.It should be understood that the example in FIG. 20 is only for ease ofunderstanding of this solution, and is not intended to limit thissolution.

If the first gesture operation is a two-hand operation, the electronicdevice may determine a distance between a left index finger and a rightindex finger as the distance between the two hands; or may determine ashortest distance between the left hand and the right hand as thedistance between the two hands; or may generate shapes of the left handand the right hand based on the plurality of contact points, to generatea distance between a left-hand boundary and a right-hand boundary.Manners of determining the distance between the two hands are notexhaustively described herein.

If the first gesture operation is a one-hand operation, the electronicdevice selects, based on the first gesture parameter corresponding tothe first gesture operation, a plurality of first contact points fromthe plurality of contact points corresponding to the first gestureoperation, and determines, based on locations of the plurality of firstcontact points, a location of the hand corresponding to the firstgesture operation. In an embodiment, if all first contact points in atleast one first contact point are located in the first region, it isdetermined that the location of the hand is the first region; or if afirst contact point outside the first region exists in the at least onefirst contact point, it is determined that the location of the hand isthe fourth region. In another embodiment, if a first contact pointlocated in the first region exists in the at least one first contactpoint, it is determined that the location of the hand is the firstregion; or if all first contact points in the at least one first contactpoint are located in the fourth region, it is determined that thelocation of the hand is the fourth region.

The following describes a process of determining the quantity of hands.The first gesture operation obtained by the electronic device may be aone-hand operation, or may be a two-hand operation. The electronicdevice may determine, based on a quantity of the contact point andlocation information of the contact point, the quantity of handscorresponding to the first gesture parameter. In an embodiment, theelectronic device determines whether a quantity of the plurality ofcontact points is greater than or equal to a first value, and whethertwo contact points whose distance is greater than a second distancethreshold exist in the plurality of contact points. If the quantity ofthe plurality of contact points is greater than the first value, and thetwo contact points whose distance is greater than the second distancethreshold exist in the plurality of contact points, the electronicdevice determines that the quantity of hands corresponding to the firstgesture operation is 2. If the quantity of the plurality of contactpoints is less than the first value, or the two contact points whosedistance is greater than the second distance threshold do not exist inthe plurality of contact points, the electronic device determines thatthe quantity of hands corresponding to the first gesture operation is 1.A value of the first value may be 2, 3, 4, 5, or another value, or maybe customized by the user. A value of the second distance threshold maybe 22 millimeters, 25 millimeters, 26 millimeters, another value, or thelike, or may be customized by the user. Specifically, the value of thesecond distance threshold may be determined with reference to factorssuch as a size of the display and a size of the hand of the user. Thisis not limited herein.

In another embodiment, the electronic device determines whether a firstsubset and a second subset exist in the plurality of contact points. Ifthe first subset and the second subset exist, the electronic devicedetermines that the quantity of hands corresponding to the first gestureoperation is 2. If the first subset or the second subset does not exist,the electronic device determines that the quantity of handscorresponding to the first gesture operation is 1. A quantity of contactpoints included in each of the first subset and the second subset isgreater than or equal to a first value. A distance between any twocontact points in the first subset is less than a second distancethreshold. A distance between any two contact points in the secondsubset is less than the second distance threshold. A distance betweenany contact point in the first subset and any contact point in thesecond subset is greater than or equal to the second distance threshold.

For more intuitive understanding of this solution, refer to FIG. 21 .FIG. 21 is a schematic diagram of a first gesture operation in a virtualkeyboard processing method according to an embodiment of thisapplication. FIG. 21 uses an example in which the value of the firstvalue is 3. FIG. 21 includes two schematic subdiagrams (a) and (b). Theschematic subdiagram (a) in FIG. 21 shows a case in which the quantityof hands corresponding to the first gesture operation is 1 (in otherwords, the first gesture operation is a one-hand operation). Theelectronic device may obtain three contact points in the schematicsubdiagram (a) in FIG. 21 , and a distance between the three contactpoints is less than 25 millimeters. The schematic subdiagram (b) in FIG.21 shows a case in which the quantity of hands corresponding to thefirst gesture operation is 2 (in other words, the first gestureoperation is a two-hand operation). The electronic device may obtaineight contact points (A1, A2, A3, A4, A5, A6, A7, and A8 in FIG. 21 ).The contact points represented by A7 and A8 are contact points generatedby a palm. A1, A2, A3, A4, A5, and A6 are contact points generated by afinger. A1, A2, and A3 form a first subset, and A4, A5, and A6 form asecond subset. Each distance between the three contact points A1, A2,and A3 is less than 25 millimeters. Each distance between the threecontact points A4, A5, and A6 is less than 25 millimeters. A distancebetween the first subset and the second subset is greater than 25millimeters. It should be understood that the example in FIG. 21 is onlyfor ease of understanding of this solution, and is not intended to limitthis solution.

Optionally, the electronic device may further divide, based on the firstgesture parameter corresponding to the first gesture operation, theplurality of contact points corresponding to the first gesture operationinto a first contact point and a second contact point. The first contactpoint is generated by the finger of the user, and the second contactpoint is generated by the palm of the user. Further, the electronicdevice may determine whether a quantity of first contact points in theplurality of contact points is greater than or equal to the first value,and whether two contact points whose distance is greater than the seconddistance threshold exist in the at least one first contact point, todetermine the quantity of hands corresponding to the first gestureoperation. Specifically, in an embodiment, the electronic device maydetermine whether an area of each contact point is greater than or equalto a first area threshold. If the area is greater than or equal to thefirst area threshold, the contact point is determined as the secondcontact point (namely, the contact point generated by the palm), or ifthe area is less than the first area threshold, the contact point isdetermined as the first contact point (namely, the contact pointgenerated by the finger). A value of the first area threshold may bepreset, or may be customized by the user. The value of the first areathreshold may be determined with reference to factors such as the sizeof the hand of the user, and is not limited herein. It should be notedthat, an example in which whether the contact point is the first contactpoint or the second contact point is determined based on the area of thecontact point is only for ease of understanding of this solution, and isnot intended to limit this solution.

The following describes a process of determining the shape informationof the hand. The first gesture operation may be a static gestureoperation, and the shape information of the hand corresponding to thefirst gesture operation may be specifically a left hand, a right hand,two fingers, a fist, other shape information, or the like. Optionally,if the first gesture operation may alternatively be a dynamic slideoperation, the shape information of the hand may be specifically a “Z”shape, a tick shape, a circle shape, or the like, which is notexhaustively described herein. Specifically, if the quantity of theplurality of contact points obtained by the electronic device is two, itmay be determined that the shape information corresponding to the firstgesture operation is two fingers. For more direct understanding of thissolution, FIG. 22 is a schematic diagram of a first gesture operation ina virtual keyboard processing method according to an embodiment of thisapplication. FIG. 22 includes two schematic subdiagrams (a) and (b). Theschematic subdiagram (a) in FIG. 22 shows the first gesture operation ofa two-finger operation, and the schematic subdiagram (b) in FIG. 22shows two contact points corresponding to the two-finger operation. Itshould be understood that the example in FIG. 22 is only for ease ofunderstanding of this solution, and is not intended to limit thissolution.

If the quantity of the plurality of touch points obtained by theelectronic device is greater than or equal to three, the electronicdevice needs to determine whether the quantity of the handscorresponding to the first gesture operation is 1 or 2. If theelectronic device determines that the first gesture operation is aone-hand operation, the electronic device needs to determine, based onthe obtained first gesture parameter, whether a shape of the handcorresponding to the first gesture operation is the left hand or theright hand. Specifically, in an embodiment, if the plurality of touchpoints corresponding to the first gesture operation are all located on aleft side of the center line of the display, the shape of the handcorresponding to the first gesture operation is the left hand; or if theplurality of touch points corresponding to the first gesture operationare all located on a right side of the center line of the display, theshape of the hand corresponding to the first gesture operation is theright hand. It should be noted that the manner of determining the lefthand or the right hand herein is only for ease of understanding offeasibility of this solution, and is not intended to limit thissolution.

In some other application scenarios, the first gesture parameter isgenerated based on the image corresponding to the first gestureoperation. Then, the electronic device may input the image correspondingto the first gesture operation into a neural network used for imagerecognition, to directly generate the first indication information.

1703: The electronic device obtains a first rule.

In this embodiment of this application, the first rule may bepreconfigured for the electronic device. The first rule indicates acorrespondence between a plurality of types of gesture operations and aplurality of types of virtual keyboards. A first type of virtualkeyboard is one type of the plurality of types of virtual keyboards. Inone case, different types of virtual keyboards in the plurality of typesof virtual keyboards have different functions. The virtual keyboardswith different functions may include a combination of any two or moretypes of the following virtual keyboards: a numeric keyboard, a functionkey keyboard, a full-size keyboard, and a custom keyboard. The functionkey keyboard is formed by function keys. In this embodiment of thisapplication, the different types of virtual keyboards have the differentfunctions, so that the virtual keyboards with the different functionsmay be provided for the user. This improves flexibility of a process inwhich the user uses the virtual keyboard, to enhance user viscosity.

In another case, different types of virtual keyboards may include acombination of any two or more types of the following virtual keyboards:a mini keyboard, a numeric keyboard, a function keyboard, a function keykeyboard, a round keyboard, an arc keyboard, a custom keyboard, and afull-size keyboard.

The first rule indicates the following information: If the first gestureoperation is a one-hand operation, the first type of virtual keyboard isany one type of the following virtual keyboards: a mini keyboard, anumeric keyboard, a function keyboard, a function key keyboard, a roundkeyboard, an arc keyboard, and a custom keyboard. The mini keyboardincludes 26 alphabet keys. The function keyboard is displayed in anapplication. A virtual key included on the function keyboard correspondsto a function of the application. It should be noted that a minikeyboard, a numeric keyboard, a function keyboard, a function keykeyboard, a round keyboard, an arc keyboard, and a custom keyboard donot need to be all configured in a same electronic device. The exampleherein is only used to prove that a one-hand operation in one electronicdevice may trigger any one type of the mini keyboard, the numerickeyboard, the function keyboard, the function key keyboard, the roundkeyboard, the arc keyboard, or the custom keyboard. If the first gestureoperation is a two-hand operation, the first type of virtual keyboard isa full-size keyboard. The full-size keyboard includes at least 26alphabet keys, and a size of the full-size keyboard is larger than thatof a mini keyboard. In this embodiment of this application, a pluralityof specific representation forms of the virtual keyboard displayed byusing the display are provided in both cases in which the first gestureoperation is the one-hand operation or a two-hand operation. Thisimproves embodiment flexibility of this solution and expands anapplication scenario of this solution.

Further, correspondences between a gesture operation and different typesof virtual keyboards in different electronic devices may be different. Asame electronic device may include a combination of at least two of thefollowing five items:

-   -   (1) If the first gesture operation is a first one-hand        operation, the first type of virtual keyboard is a mini        keyboard.

The first one-hand operation may be a left-hand operation, or may be aright-hand operation. The first one-hand operation may be a one-handoperation with a stylus held, or may be a one-hand operation without astylus. For more intuitive understanding of this solution, refer to FIG.23 . FIG. 23 is a schematic diagram of the first type of virtualkeyboard in the virtual keyboard processing method according to anembodiment of this application. FIG. 23 uses an example in which thefirst one-hand operation is holding the stylus by the user. Theelectronic device detects that the first gesture operation is the firstone-hand operation, and a corresponding first type of virtual keyboardis a mini keyboard. The mini keyboard includes 26 alphabet keys, and asize of the mini keyboard is smaller than that of a full-size keyboard.It should be understood that the example in FIG. 23 is only for ease ofunderstanding of this solution, and is not intended to limit thissolution.

In this embodiment of this application, if the first gesture operationis the one-hand operation, the first type of virtual keyboard is themini keyboard. This helps improve flexibility of a process of inputtinga letter by the user.

-   -   (2) If the first gesture operation is the right-hand operation,        the first type of virtual keyboard is the numeric keyboard; or        if the first gesture operation is the left-hand operation, the        first type of virtual keyboard is the function keyboard.

A virtual key included on the function keyboard corresponds to afunction of the application. For example, if the first gesture operationis obtained from a game application, the function keyboard may be a gamekeyboard, and the game keyboard is provided with keys commonly used fora game. For another example, if the first gesture operation is obtainedfrom a drawing application, the function keyboard may be a common key indrawing software, and the like, which is not exhaustively describedherein.

For more intuitive understanding of this solution, refer to FIG. 24 andFIG. 25 . FIG. 24 and FIG. 25 show two schematic diagrams of the firsttype of virtual keyboard in the virtual keyboard processing methodaccording to an embodiment of this application. FIG. 24 and FIG. 25 bothinclude two schematic subdiagrams (a) and (b). First refer to FIG. 24 .The schematic subdiagram (a) in FIG. 24 shows that the first gestureoperation is a right-hand operation, and the schematic subdiagram (b) inFIG. 24 shows that the first type of virtual keyboard is specificallyrepresented as a numeric keyboard. Refer to FIG. 25 . The schematicsubdiagram (a) in FIG. 25 shows that the first gesture operation is aleft-hand operation, and the schematic subdiagram (b) in FIG. 25 showsthat the first type of virtual keyboard is specifically represented as adesigner keyboard. It should be understood that examples in FIG. 24 andFIG. 25 are only for ease of understanding of this solution, and are notintended to limit this solution.

In this embodiment of this application, if the first gesture operationis the right-hand operation, the first type of virtual keyboard is thenumeric keyboard; or if the first gesture operation is the left-handoperation, the first type of virtual keyboard is the function keyboard.This better satisfies a habit of using a physical keyboard by the user,to reduce a difference between the virtual keyboard and the physicalkeyboard and enhance user viscosity.

-   -   (3) If the first gesture operation is a one-hand operation in a        first region on the display, the first type of virtual keyboard        is a function key keyboard, and the first region is located in a        lower left corner or a lower right corner of the display. For a        concept of the first region, refer to the description in        operation 202, and details are not described herein again.

One or more function keys are shown in the function key keyboard. Thefunction key keyboard includes but is not limited to a Shift key, a Ctrlkey, an Alt key, an Fn (an abbreviation of function) key, a Delete key,and the like. Specific function keys included in the function keykeyboard may be limited with reference to an actual applicationscenario, and are not limited herein. The Fn key is a modified key usedon a computer keyboard, and a main function of the Fn key is to definemore two sense keys in a key combination manner on a compact keyboard.For more intuitive understanding of this solution, refer to FIG. 26 andFIG. 27 . FIG. 26 and FIG. 27 show two schematic diagrams of the firsttype of virtual keyboard in the virtual keyboard processing methodaccording to an embodiment of this application. FIG. 26 and FIG. 27include two schematic subdiagrams (a) and (b). FIG. 26 shows a case inwhich the first region is located in the lower left corner of thedisplay. As shown in the schematic subdiagram (a) in FIG. 26 , when theuser places one hand in the first region on the display, the schematicsubdiagram (b) in FIG. 26 is triggered to be displayed. The first typeof virtual keyboard is a function key keyboard. Still refer to FIG. 27 .FIG. 27 shows a case in which the first region is located in the lowerright corner of the display. As shown in the schematic subdiagram (a) inFIG. 27 , when the user places one hand in the first region on thedisplay, the schematic subdiagram (b) in FIG. 27 is triggered to bedisplayed. The first type of virtual keyboard is a function keykeyboard. It should be understood that examples in FIG. 26 and FIG. 27are only for ease of understanding, and are not intended to limit thesolution.

In this embodiment of this application, the function key is configuredin the lower left corner or the lower right corner of the physicalkeyboard. If the first gesture operation is the one-hand operation inthe first region on the display, the first type of virtual keyboard is afunction key keyboard. Because a triggering gesture is the same as ahabit of using a physical keyboard by the user, it is convenient for theuser to remember the triggering gesture. This reduces embodimentdifficulty of this solution, and enhances user viscosity.

-   -   (4) If the first gesture operation is a one-hand operation with        less than three contact points, the first type of virtual        keyboard is a round keyboard or an arc keyboard.

The round keyboard means a keyboard with a round shape, and the arckeyboard means a keyboard with an arc shape. Optionally, if the firstgesture operation is a one-hand operation with two contact points, andthe distance between the two contact points is greater than a thirddistance threshold, the first type of virtual key is a round keyboard oran arc keyboard, and a value of the third distance threshold may be 58millimeters, 60 millimeters, 62 millimeters, or the like, which is notexhaustively described herein. For more intuitive understanding of thissolution, refer to FIG. 28 . FIG. 28 is a schematic diagram of the firsttype of virtual keyboard in the virtual keyboard processing methodaccording to an embodiment of this application. FIG. 28 includes twoschematic subdiagrams (a) and (b). The schematic subdiagram (a) in FIG.28 shows that the first gesture operation is a one-hand operation withtwo contact points (namely, less than three contact points). Theschematic subdiagram (b) in FIG. 28 shows that the first type of virtualkeyboard is a round keyboard. It should be understood that the examplein FIG. 28 is only for ease of understanding of this solution, and isnot intended to limit this solution.

In this embodiment of this application, when the first gesture operationis the one-hand operation with less than three contact points, the roundkeyboard or the arc keyboard may be further provided. In this way, botha keyboard existing in a physical keyboard and a keyboard that does notexist in the physical keyboard can be provided. This enriches keyboardtypes, provides more choices for the user, and further enhancesselection flexibility of the user.

-   -   (5) If the first gesture operation is a two-hand operation, the        first type of virtual keyboard is a full-size keyboard.

For more intuitive understanding of this solution, refer to FIG. 29 .FIG. 29 is a schematic diagram of the first type of virtual keyboard inthe virtual keyboard processing method according to an embodiment ofthis application. FIG. 29 shows that a virtual keyboard corresponding tothe two-hand operation is a full-size keyboard. The full-size keyboardincludes at least 26 alphabet keys. It can be learned by comparing FIG.29 and FIG. 23 that a size of the full-size keyboard is greater thanthat of a mini keyboard. It should be understood that the example inFIG. 29 is only for ease of understanding of this solution, and is notintended to limit this solution.

It should be noted that, in the foregoing items (1) to (5), items (1)and (2) are incompatible with each other, and cannot be configured in asame electronic device. Other items may be randomly combined.

Further, in an embodiment, the first rule directly includes thecorrespondence between the plurality of types of gesture operations andthe plurality of types of virtual keyboards, as shown in the foregoingitems (1) to (5). The first rule includes a correspondence between aplurality of pieces of first identification information and a pluralityof pieces of second identification information. The first identificationinformation uniquely indicates one type of gesture operation, and thesecond identification information uniquely indicates one type of virtualkeyboard.

In another embodiment, the first rule includes a correspondence betweena plurality of groups of conditions and the plurality of types ofvirtual keyboards. Each group of conditions in the plurality of groupsof conditions corresponds to one type of gesture operation. That is,each group of conditions in the plurality of groups of conditions isused to limit one type of gesture operation.

Specifically, if the first gesture parameter is collected by using thedisplay, one group of conditions used to limit the one-hand operationmay be that the quantity of touch points is greater than or equal to thefirst value, and each distance between the plurality of touch points isless than the second distance threshold. For values of the first valueand the second distance threshold, refer to the foregoing descriptions.Optionally, one group of conditions used to limit the one-hand operationmay be that a quantity of contact points whose areas are less than thefirst area threshold is greater than or equal to the first value, andeach distance between the plurality of contact points whose areas areless than the first area threshold is less than the second distancethreshold.

One group of conditions used to limit the left-hand operation may bethat a quantity of contact points is greater than or equal to the firstvalue, each distance between the plurality of contact points is lessthan the second distance threshold, and the plurality of contact pointsare all located on a left side of the center line of the display.Alternatively, one group of conditions used to limit the left-handoperation may be that a quantity of contact points is greater than orequal to the first value, each distance between the plurality of contactpoints is less than the second distance threshold, and the plurality ofcontact points are all located on a right side of the center line of thedisplay.

One group of conditions used to limit the one-hand operation in thefirst region may be that a quantity of contact points is greater than orequal to the first value, each distance between the plurality of contactpoints is less than the second distance threshold, and the plurality ofcontact points are all located in the first region on the display.Alternatively, one group of conditions used to limit the one-handoperation in the first region may be that a quantity of contact pointsis greater than or equal to the first value, each distance between theplurality of contact points is less than the second distance threshold,and at least one of the plurality of contact points is located in thefirst region on the display.

One group of conditions used to limit the two-hand operation may be thata plurality of contact points include the first subset and the secondsubset, quantities of contact points in the first subset and the secondsubset are both greater than or equal to the first value, each distancebetween the plurality of contact points in the first subset is less thanthe second distance threshold, and each distance between the pluralityof contact points in the second subset is less than the second distancethreshold, a distance between any contact point in the first subset andany contact point in the second subset is greater than the seconddistance threshold. Optionally, one group of conditions used to limit atwo-hand operation may be that a plurality of contact points whose areasare less than the first area threshold include the first subset and thesecond subset.

It should be noted that the foregoing provides a plurality of groups ofconditions used to limit a plurality of types of gesture operations.However, a specific type of gesture operation configured in oneelectronic device and a specific restrictive condition corresponding toeach type of gesture operation may be flexibly set with reference to anactual application scenario. This is not limited herein.

Optionally, the first rule includes a first sub-rule. The first sub-ruleis obtained by performing a custom operation on at least one type ofgesture operation and/or at least one type of virtual keyboard. In thisembodiment of this application, the user may customize a type of atriggering gesture and/or a virtual keyboard, so that a display processof the virtual keyboard better meets expectation of the user, and userviscosity of this solution is further increased.

Specifically, the electronic device has a “setting” function, and afirst setting interface for the first rule is configured for the“setting” function, so that the user may customize, by using the firstsetting interface, any one or more of the following: a gestureoperation, a virtual keyboard, and a correspondence between the gestureoperation and the virtual keyboard. For more intuitive understanding ofthis solution, refer to FIG. 30 to FIG. 32 . FIG. 30 and FIG. 31 areschematic diagrams of the first setting interface in the virtualkeyboard processing method according to an embodiment of thisapplication. FIG. 32 is a schematic diagram of a custom gestureoperation in the virtual keyboard processing method according to anembodiment of this application. FIG. 30 includes four schematicsubdiagrams (a), (b), (c), and (d). The schematic subdiagram (a) in FIG.30 represents the correspondence between the plurality of types ofgesture operations and the plurality of types of virtual keyboards thatis preconfigured in the electronic device. As shown in the schematicsubdiagram (a) in FIG. 30 , a one-hand operation triggers display of anumeric keyboard, a two-hand operation triggers display of a full-sizekeyboard, and a two-finger operation triggers display of a roundkeyboard. When the user taps “Numeric keyboard” (a type of virtualkeyboard), the schematic subdiagram (b) in FIG. 30 is triggered to bedisplayed. That is, a custom operation is performed on the “Numerickeyboard”. In the schematic subdiagram (b) in FIG. 30 , the userperforms a touch and hold operation, a double-tap operation, atriple-tap operation, or another type of contact operation on any key onthe numeric keyboard. In FIG. 30 , the touch and hold operation on a key2 on the numeric keyboard is used as an example herein. Delete icons(namely, “x” symbols shown in FIG. 30 ) appear on some keys on thenumeric keyboard, that is, the schematic subdiagram (c) in FIG. 30 istriggered to be displayed. In the schematic subdiagram (c) in FIG. 30 ,a key with a “x” symbol is a key that can be deleted. In addition, theuser may further move a location of a key on the numeric keyboard bypressing and holding the key and dragging the key. The foregoingoperations of deleting a key and moving a location of a key may beexecuted for a plurality of times. As shown in the schematic subdiagram(d) in FIG. 30 , the user deletes number keys except 1 to 9, toimplement customization of the numeric keyboard. It should be notedthat, the example in FIG. 30 is only for ease of understanding of thissolution, and the deleting or moving operation on the virtual key on thevirtual keyboard may alternatively be implemented through anotheroperation. In addition, FIG. 30 only uses customization of the numerickeyboard as an example, and customization of another type of virtualkeyboard may also be performed.

Still refer to FIG. 31 . FIG. 31 needs to be described with reference toFIG. 30 . When the user taps “One-hand operation” in the schematicsubdiagram (a) in FIG. 30 , a schematic subdiagram (a) in FIG. 31 isdisplayed. A “Custom gesture” icon is displayed in the schematicsubdiagram (a) in FIG. 31 . The user taps the icon, and a schematicsubdiagram (b) in FIG. 31 is displayed. The user inputs a custom gesturebased on a prompt of the schematic subdiagram (b) in FIG. 31 . That is,a “fist-shaped” gesture is input as shown in a schematic subdiagram (c)in FIG. 31 . In an embodiment, the electronic device may preset a firstduration threshold, where the first duration threshold is a totalduration threshold for inputting the custom gesture. When the inputduration threshold is reached, a schematic subdiagram (d) in FIG. 31 isdisplayed. In another embodiment, the electronic device mayalternatively preset a second duration threshold, where the secondduration threshold is a threshold for the user to stop inputting agesture. When the electronic device detects that duration in which theuser stops inputting a gesture reaches the second duration threshold,the schematic subdiagram (d) in FIG. 31 is displayed. The manners ofdisplaying the schematic subdiagram (d) in FIG. 31 are not exhaustivelydescribed herein. In the schematic subdiagram (d) in FIG. 31 , an iconused to indicate “OK” and an icon used to indicate “Re-input a customgesture” are displayed on the display. If the user taps the “OK” icon,the electronic device determines a gesture operation obtained in theschematic subdiagram (c) in FIG. 31 as a custom gesture 1. Theelectronic device updates the first rule, and updates a correspondencebetween the one-hand operation and the numeric keyboard to acorrespondence between the custom gesture 1 and the numeric keyboard. Aschematic subdiagram (e) in FIG. 31 is displayed. In this way, thecustom gesture 1 is confirmed as a triggering gesture of the numerickeyboard, and customization of the triggering gesture is completed. Inaddition, a schematic subdiagram (f) in FIG. 31 represents a shape(namely, a “fist” shape) of the custom gesture 1 obtained by theelectronic device. It should be understood that the example in FIG. 31is only for ease of understanding of this solution, and is not intendedto limit this solution. The user may further set another shape of customgesture. This is not limited herein.

Still refer to FIG. 32 . FIG. 32 needs to be described with reference toFIG. 31 . The user starts to input a custom gesture based on the promptin the schematic subdiagram (b) in FIG. 31 , that is, a schematicsubdiagram (a) in FIG. 32 and a schematic subdiagram (b) in FIG. 32 aredisplayed. FIG. 32 shows an example in which the custom gesture is adynamic gesture. In FIG. 32 , the custom gesture is a dynamic gesture ofextending fingers after making a fist. After the electronic devicedetermines that the user completes inputting the custom gesture, theschematic diagram (d) in FIG. 31 may be displayed. For subsequentoperations, refer to the foregoing descriptions of FIG. 31 . Details arenot described herein again.

1704: The electronic device determines, according to the first rule,whether the first gesture operation is included in a plurality of typesof prestored gesture operations. If the first gesture operation is oneof the plurality of types of prestored gesture operations, operation1705 is performed; or if the first gesture parameter is not included inthe plurality of types of prestored gesture operations, operation 1701is performed again.

In this embodiment of this application, if the first rule includes thecorrespondence between the plurality of types of gesture operations andthe plurality of types of virtual keyboards, the electronic device needsto generate the first indication information by performing operation1702. The first indication information needs to include quantityinformation of a hand corresponding to the first gesture operation,location information of the hand corresponding to the first gestureoperation, and shape information of the hand corresponding to the firstgesture operation. After obtaining the first indication information, theelectronic device may determine whether the first gesture operation isone of the plurality of types of gesture operations preconfigured in theelectronic device.

If the first rule includes a plurality of groups of conditions, afterobtaining the first gesture parameter corresponding to the first gestureoperation by performing operation 1701, the electronic device maydirectly determine whether the first gesture operation meets any one ofthe plurality of groups of conditions included in the first rule. Fordescriptions of the plurality of groups of conditions, refer to thedescriptions in operation 1703.

1705: The electronic device displays the first type of virtual keyboardby using the display.

In this embodiment of this application, after determining, according tothe first rule, that the first gesture operation is a target type ofgesture operation in the plurality of types of gesture operationsprestored in the electronic device, the electronic device may obtain thefirst type of virtual keyboard corresponding to the target type ofgesture operation (that is, obtain the first type of virtual keyboardcorresponding to the first gesture operation). Further, the electronicdevice displays the first type of virtual keyboard by using the display.In this embodiment of this application, the first rule is preconfiguredfor the electronic device. The first rule indicates the correspondencebetween the plurality of types of gesture operations and the pluralityof types of virtual keyboards. After detecting the first gestureoperation acting on the display, the electronic device may obtain,according to the first rule, the first type of virtual keyboardcorresponding to the specific first gesture operation. This can improveefficiency of a matching process of the virtual keyboard.

Specifically, in an embodiment, a location of the first type of virtualkeyboard on the display is fixed in the process of displaying the firsttype of virtual keyboard. In another embodiment, a location of the firsttype of virtual keyboard on the display can be moved with a hand of theuser in the process of displaying the first type of virtual keyboard.

In another embodiment, the plurality of types of virtual keyboards aredivided into a third subset and a fourth subset. The third subset andthe fourth subset each include at least one type of virtual keyboard. Alocation of each type of virtual keyboard in the third subset is fixedin a display process. A location of each type of virtual keyboard in thefourth subset can be moved with a hand of the user in the displayprocess. In other words, in the plurality of types of virtual keyboards,locations of some types of virtual keyboards are fixed in the process ofdisplaying the virtual keyboards, and locations of the other types ofvirtual keys is moved with the hand of the user in the process ofdisplaying the virtual keyboards.

Optionally, if the first type of virtual keyboard is a mini keyboard, anumeric keyboard, or a function keyboard, the first type of virtualkeyboard can be moved with the hand of the user, in other words, thethird subset includes any one or a combination of the following: a minikeyboard, a numeric keyboard, and a function keyboard. If the first typeof virtual keyboard is a round keyboard, an arc keyboard, or a full-sizekeyboard, the location of the first type of virtual keyboard can befixed in the display process, in other words, the fourth subset includesany one or a combination of the following: a round keyboard, an arckeyboard, or a full-size keyboard.

Further, for the virtual keyboard that is moved with the hand of theuser, when the user wants to disable a movement function of the virtualkeyboard, the user may input a second gesture operation by using thedisplay. The second gesture operation may be a double-tap operation, atriple-tap operation, a tap operation, another operation, or the like.This is not limited herein.

The following describes an initial display location of the virtualkeyboard. The initial display location of the first type of virtualkeyboard may be preset, or may be determined by the electronic devicebased on a finger location. For example, if the first type of virtualkeyboard is a numeric keyboard, when the numeric keyboard is initiallydisplayed, a key corresponding to a number 5 may be configured under anindex finger. For another example, if the first type of virtual keyboardis a mini keyboard, the initial display location of the mini keyboardmay be under a hand. The examples herein are only for ease ofunderstanding, and are not intended to limit the solution.

The following describes a size of the virtual keyboard. In anembodiment, a size of each type of virtual keyboard in the electronicdevice is fixed. In another embodiment, a same type of virtual keyboardmay have a different size to adapt to a different size of finger/hand.Specifically, a same type of virtual keyboard of at least two differentsizes may be prestored in the electronic device, and a correspondencebetween a size of a contact point and a different size is prestored inthe electronic device. After determining the first type of virtualkeyboard, the electronic device may obtain a target size correspondingto the size of the contact point, and display a first type of virtualkeyboard of the target size.

Optionally, before the electronic device displays the first type ofvirtual keyboard by using the display, the electronic device may furtherobtain a first angle based on the first indication information generatedin operation 1702. The first angle indicates a relative angle betweenthe hand in the first gesture corresponding to the first gestureoperation and a side of the display. Alternatively, the first angleindicates a relative angle between the hand in the first gesturecorresponding to the first gesture operation and a center line of thedisplay. Operation 1705 may include: The electronic device obtains afirst display angle of the first type of virtual keyboard based on thefirst angle, and displays the first type of virtual keyboard based onthe first display angle by using the display. The first display angleindicates a relative angle between a side of the first type of virtualkeyboard and the side of the display. Alternatively, the first displayangle indicates a relative angle between a side of the first type ofvirtual keyboard and the center line of the display.

Specifically, in an embodiment, the electronic device determines whetherthe first angle is greater than or equal to a preset angle threshold. Ifthe first angle is greater than or equal to the preset angle threshold,the electronic device obtains the first display angle, and displays thefirst type of virtual keyboard at the first display angle by using thedisplay. A value of the preset angle threshold may be 25 degrees, 28degrees, 30 degrees, 32 degrees, 35 degrees, another value, or the like.This is not limited herein.

Further, if the first type of virtual keyboard is a full-size keyboard,the first angle includes a relative angle of a left hand and a relativeangle of a right hand. The full-size keyboard is divided into a firstsub-keyboard and a second sub-keyboard. The first sub-keyboard and thesecond sub-keyboard include different virtual keys on the full-sizekeyboard, and the first display angle includes a display angle of thefirst sub-keyboard and a display angle of the second sub-keyboard. Ifthe first angle indicates the relative angle between the hand in thefirst gesture corresponding to the first gesture operation and the sideof the display, the first display angle indicates a relative anglebetween a bottom side of the virtual keyboard and the side of thedisplay. Further, the display angle of the first sub-keyboard indicatesa relative angle between a side of the first sub-keyboard and the sideof the display, and the display angle of the second sub-keyboardindicates a relative angle between a side of the second sub-keyboard andthe side of the display. If the first angle indicates the relative anglebetween the hand in the first gesture corresponding to the first gestureoperation and the center line of the display, the first display angleindicates a relative angle between a bottom side of the virtual keyboardand the center line of the display. Further, the display angle of thefirst sub-keyboard indicates a relative angle between a side of thefirst sub-keyboard and the center line of the display, and the displayangle of the second sub-keyboard indicates a relative angle between aside of the second sub-keyboard and the center line of the display.

For more intuitive understanding of this solution, refer to FIG. 33 .FIG. 33 is a schematic diagram of the first type of virtual keyboard inthe virtual keyboard processing method according to an embodiment ofthis application. FIG. 33 shows an example in which the value of thepreset angle threshold is 30. FIG. 33 includes three schematicsubdiagrams (a), (b), and (c). The schematic subdiagram (a) in FIG. 33represents eight first contact points corresponding to a two-handoperation (one type of first gesture operation). The schematicsubdiagram (b) in FIG. 33 separately shows the first sub-angle (namely,the relative angle of the left hand) formed by the first straight lineand the bottom side of the display and the second sub-angle (namely, therelative angle of the right hand) formed by the second straight line andthe bottom side of the display, where values of the first sub-angle andthe second sub-angle are both 32 degrees. The schematic subdiagram (c)in FIG. 33 represents the first type of virtual keyboard that isdisplayed at the first display angle by using the display. It should beunderstood that the example in FIG. 33 is only for ease of understandingof this solution, and is not intended to limit this solution.

If the first type of virtual keyboard is a mini keyboard, a numerickeyboard, a function keyboard, or a function key keyboard, the firstangle is a one-hand angle, and the first display angle is a relativeangle of the entire virtual keyboard.

In another embodiment, after obtaining the first angle, the electronicdevice determines the first display angle of the first type of virtualkeyboard as the first angle, and displays the first type of virtualkeyboard based on the first angle by using the display. If the firstangle indicates the relative angle between the hand in the first gesturecorresponding to the first gesture operation and the side of thedisplay, the first display angle indicates the relative angle betweenthe bottom side of the virtual keyboard and the side of the display. Ifthe first angle indicates the relative angle between the hand in thefirst gesture corresponding to the first gesture operation and the sideof the display, the first display angle indicates the relative anglebetween the bottom side of the virtual keyboard and the center line ofthe display.

In this embodiment of this application, a relative angle (namely, thefirst angle) between the hand of the user and a side or a center line ofa display interface is obtained, and the display angle of the virtualkeyboard is determined based on the first angle. In this way, thedisplay angle of the keyboard is more suitable for a placement angle ofthe hand of the user, and it is more comfortable and convenient for theuser to input by using the virtual keyboard.

Optionally, if the electronic device determines that the first gestureparameter is a two-hand operation, that is, determines that the firsttype of virtual keyboard is a full-size keyboard, the electronic devicefurther obtains the distance between the two hands, and determineswhether the distance between the two hands is greater than or equal to afirst distance threshold. If the distance between the two hands is lessthan or equal to the first distance threshold, the electronic devicedisplays the first type of virtual keyboard in an integrated manner byusing the display; or if the distance between the two hands is greaterthan the first distance threshold, the electronic device displays thefirst sub-keyboard by using a second region on the display, and displaysthe second sub-keyboard by using a third region on the display. Thesecond region and the third region are different regions on the display.The first sub-keyboard and the second sub-keyboard include differentvirtual keys on the full-size keyboard. A value of the first distancethreshold may be 70 millimeters, 75 millimeters, 80 millimeters, or thelike. This is not limited herein.

For more intuitive understanding of this solution, refer to FIG. 34 .FIG. 34 is a schematic diagram of the first type of virtual keyboard inthe virtual keyboard processing method according to an embodiment ofthis application. FIG. 34 shows an example in which the value of thefirst distance threshold is 75 millimeters. FIG. 34 includes twoschematic subdiagrams (a) and (b). The schematic subdiagram (a) in FIG.34 shows that the distance between the two hands in a two-hand operationis 80 millimeters. Because 80 millimeters are greater than 75millimeters, the schematic subdiagram (b) in FIG. 34 separately displaysthe first sub-keyboard in the second region of the display, and thesecond sub-keyboard in the third region on the display. It should beunderstood that the example in FIG. 34 is only for ease of understandingof this solution, and is not intended to limit this solution.

In this embodiment of this application, whether to display the virtualkeyboard in an integrated manner or in a separated manner may bedetermined based on the distance between the two hands of the user. Thisfurther improves flexibility of a process of displaying the virtualkeyboard, facilitates the user to use the displayed virtual keyboard,and further enhances user viscosity of this solution.

Further, optionally, if the electronic device determines that the firstgesture parameter is a two-hand operation, that is, determines that thefirst type of virtual keyboard is a full-size keyboard, the electronicdevice further obtains the distance between the two hands, anddetermines whether the distance between the two hands is less than afourth distance threshold. If the distance between the two hands is lessthan the fourth distance threshold, the electronic device displaysprompt information to indicate the user to adjust the distance betweenthe two hands, and/or the electronic device directly displays thefull-size keyboard in an integrated manner. Optionally, the electronicdevice displays a full-size keyboard of a minimum size in an integratedmanner. The foregoing prompt information may be a text prompt, a voiceprompt, a vibration prompt, another type of prompt, or the like. Thedisplay manner of the prompt information is not exhaustively describedherein.

For more intuitive understanding of this solution, refer to FIG. 35 .FIG. 35 is a schematic diagram of the first type of virtual keyboard inthe virtual keyboard processing method according to an embodiment ofthis application. FIG. 35 includes two schematic subdiagrams (a) and(b). The schematic subdiagram (a) in FIG. 35 shows that the distancebetween the two hands in a two-hand operation is 0 millimeters. Becausethe distance between the two hands is excessively small, B1 in theschematic subdiagram (b) in FIG. 35 represents the prompt information,to prompt the user that the two hands are excessively close, and thefull-size keyboard is displayed in an integrated manner. It should beunderstood that the example in FIG. 35 is only for ease of understandingof this solution, and is not intended to limit this solution.

Optionally, the display is further provided with a plurality ofvibration feedback elements. If the location of the first type ofvirtual keyboard on the display is fixed in the process of displayingthe first type of virtual keyboard, after the electronic device displaysthe first type of virtual keyboard by using the display, the electronicdevice may further detect a first contact operation acting on thedisplay, and obtains, in response to the first contact operation, firstlocation information of a first contact point corresponding to the firstcontact operation. The first location information corresponds to a firstvirtual key on the virtual keyboard. If the first virtual key is ananchor point key, the electronic device obtains a first vibrationfeedback element from the plurality of vibration feedback elements. Thefirst vibration feedback element is a vibration feedback element thatmatches the first virtual key. The electronic device indicates the firstvibration feedback elements that match the first virtual key to emit avibration wave, to perform a first feedback operation. The firstfeedback operation is used to prompt that the first virtual key is ananchor point key. It should be noted that, for meaning of the nouns inthe foregoing descriptions, specific embodiments of the operations, andbeneficial effects, refer to the descriptions in Embodiment 1. Detailsare not described herein again. A purpose of setting the anchor pointkey is to help the user remember a location of the anchor point key, tohelp the user implement touch typing on various types of virtualkeyboards. Therefore, a specific virtual key on each type of virtualkeyboard may be flexibly configured as the anchor point key.

For further understanding of this solution, the following gives examplesof the anchor point key on each type of virtual keyboard with referenceto various types of virtual keyboards shown above. For example, thefirst type of virtual keyboard is a numeric keyboard shown in FIG. 24 ,and the anchor point key may be a virtual key indicated by the number“5”. For another example, if the first type of virtual keyboard is afunction key keyboard shown in FIG. 26 , the anchor point key may be aCtrl key and a Shift key. It should be understood that the examplesherein are only for ease of understanding of a concept of the anchorpoint key on various types of virtual keyboards. Specifically, aspecific virtual key on each type of virtual keyboard may be flexiblyset as the anchor point key by a developer with reference to an actualapplication scenario, or may be customized by the user. This is notlimited herein.

1706: The electronic device obtains a contact operation on a firstvirtual key on a function key keyboard.

In some embodiments of this application, the first type of virtualkeyboard displayed by the electronic device is a function key keyboard.Then, the electronic device may further obtain a contact operation onone or more first virtual keys on the function key keyboard. The contactoperation may be a press operation or a touch operation. For example,the first virtual key may be a Ctrl key, or may include both a Ctrl keyand a Shift key. This is not limited herein.

1707: The electronic device highlights a second virtual key on thedisplay in response to the contact operation, where the second virtualkey is a key other than the first virtual key in a shortcut keycombination.

In some embodiments of this application, the electronic devicehighlights at least one second virtual key on the display in response tothe contact operation. Each second virtual key in the at least onesecond virtual key can form shortcut keys together with the firstvirtual key, and the second virtual key is the key other than the firstvirtual key in the shortcut key combination. Highlighting includes butis not limited to highlight display, bold display, flash display, or thelike. This is not limited herein. For example, in a drawing application,a key combination of a Ctrl key, a Shift key, and an I key can provide afunction of color inversion of a currently processed image. In thiscase, the first virtual key includes the Ctrl key and the Shift key, andthe second virtual key is the virtual I key. Color inversion of acurrently processed image means changing a color of the currentlyprocessed image to a complementary color of the currently processedimage. It should be understood that the example herein is only for easeof understanding, and is not intended to limit this solution.

For more intuitive understanding of this solution, refer to FIG. 36 .FIG. 36 is a schematic diagram of the second virtual key in the virtualkeyboard processing method according to an embodiment of thisapplication. FIG. 36 shows an example in which a current application isa drawing application. FIG. 36 includes four schematic subdiagrams (a),(b), (c), and (d). The schematic subdiagram (a) in FIG. 36 shows that afunction key keyboard is displayed on the display. The schematicsubdiagram (b) in FIG. 36 shows that the user performs a press operationon the Ctrl key and the Shift key, to trigger the electronic device tohighlight, on the display, a key on which a letter I is located. Theschematic subdiagram (c) in FIG. 36 shows that the user taps the key onwhich the letter I is located, to trigger display of the schematicsubdiagram (d) in FIG. 36 , in other words, to trigger color inversionof a currently displayed image. It should be understood that the examplein FIG. 36 is only for ease of understanding of this solution, and isnot intended to limit this solution.

Optionally, in response to the contact operation, the electronic devicehighlights the second virtual key on the display, and further displays afunction of a shortcut key corresponding to each second virtual key.

For more intuitive understanding of this solution, refer to FIG. 37(a)to FIG. 37(c). FIG. 37(a) to FIG. 37(c) show a schematic diagram of thesecond virtual key in the virtual keyboard processing method accordingto an embodiment of this application. FIG. 37(a) to FIG. 37(c) show anexample in which a current application is a power point displayapplication, and the virtual keyboard floats on a power point displayinterface. FIG. 37(a) to FIG. 37(c) are three schematic subdiagrams. Theschematic subdiagram FIG. 37(a) shows that a function key keyboard isdisplayed on the display. The schematic subdiagram FIG. 37(b) shows thatthe user performs a press operation on the Ctrl key, and the schematicsubdiagram FIG. 37(c) is triggered to be displayed. That is, theelectronic device highlights a plurality of second virtual keys on thedisplay, and further displays the function of the shortcut keycorresponding to each second virtual key, to enable five shortcutfunctions: save, cut (corresponding to a scissors icon in FIG. 37(c)),copy, paste, and insert. It should be understood that the example inFIG. 37(a) to FIG. 37(c) is only for ease of understanding of thissolution, and is not intended to limit this solution.

In this embodiment of this application, in the process of displaying thefunction key keyboard on the display, the electronic device obtains thecontact operation on the first virtual key on the function key keyboardand highlights the second virtual key on the display in response to thecontact operation. The second virtual key is the key other than thefirst virtual key in the shortcut key combination. Because the functionkey keyboard occupies a small area, an area required for displaying thevirtual keyboard is reduced. When the user performs the contactoperation on the first virtual key on the function key keyboard, thesecond virtual key in the shortcut key combination can be automaticallydisplayed. This ensures a requirement of the user for the shortcut keysand avoids waste of a display area on the display.

For more intuitive understanding of this solution, refer to FIG. 38 .FIG. 38 is a schematic flowchart of the virtual keyboard processingmethod in this embodiment of this application. FIG. 38 shows an examplein which this embodiment of this application is applied to a textediting application. FIG. 38 includes four schematic subdiagrams (a),(b), (c), and (d). In the schematic subdiagram (a) in FIG. 38 , theelectronic device obtains the first gesture parameter corresponding to atwo-hand operation, obtains, based on the first rule and the firstgesture parameter corresponding to the two-hand operation, the full-sizekeyboard corresponding to the two-hand operation, and displays thefull-size keyboard by using the display. The user inputs content “Mainingredient Low-gluten flour:” by using the full-size keyboard. In theschematic subdiagram (b) in FIG. 38 , the electronic device detects thatthe user lifts one hand, and stops displaying the full-size keyboard onthe display. The electronic device obtains a first gesture parametercorresponding to a right-hand operation, obtains, based on the firstrule and the first gesture parameter corresponding to the right-handoperation, a numeric keyboard corresponding to the right-hand operation,and displays the numeric keyboard by using the display. That is, asshown in schematic subdiagram (c) in FIG. 38 , the numeric keyboard isdisplayed below the hand of the user, and the user inputs content “145”by using the numeric keyboard. As shown in the schematic subdiagram (d)in FIG. 38 , in the process of displaying the numeric keyboard, theelectronic device detects that the hand of the user moves above thedisplay, the electronic device obtains a movement track of the hand, andcontrols the numeric keyboard to be moved with the hand of the user.When the user inputs a double-tap operation by using the display, alocation of the numeric keyboard is fixed. It should be noted that theexample in FIG. 38 is only for ease of understanding a manner ofswitching between the plurality of types of virtual keyboards, and isnot intended to limit this solution.

In this embodiment of this application, the electronic device isprovided with a plurality of different types of virtual keyboards, andthe virtual keys included in the different types of virtual keyboardsare not completely the same. A user can enable different types ofvirtual keyboards through different gesture operations. In other words,the virtual keyboard no longer displays only 26 letters, but providesmore virtual keys for the user by using the different types of virtualkeyboards. This improves flexibility of a process in which the userenables the virtual keyboard, and helps provide more abundant virtualkeys, so that an additional physical keyboard does not need to beprovided.

According to the embodiments corresponding to FIG. 1 to FIG. 38 , tobetter implement the foregoing solutions in embodiments of thisapplication, the following further provides a related device used toimplement the foregoing solutions. FIG. 39 is a schematic diagram of astructure of an electronic device according to an embodiment of thisapplication. The electronic device 1 includes a display 50, a memory 40,one or more processors 10, and one or more programs 401. The display 50in FIG. 39 and the touchscreen 20 in FIG. 1 to FIG. 29 may be a sameelement. The one or more programs 401 are stored in the memory 40. Whenthe one or more processors 10 execute the one or more programs 401, theelectronic device is enabled to perform the following operations:selecting, in response to a detected first gesture operation, a firsttype of virtual keyboard corresponding to the first gesture operationfrom a plurality of types of virtual keyboards, where virtual keysincluded in different types of virtual keyboards in the plurality oftypes of virtual keyboards are not completely the same; and displayingthe first type of virtual keyboard by using the display 50.

In a possible design, when the one or more processors 10 execute the oneor more programs 401, the electronic device is enabled to specificallyperform the following operation: selecting, according to a first rule, afirst type of virtual keyboard corresponding to a first gestureoperation from a plurality of types of virtual keyboards, where thefirst rule indicates a correspondence between a plurality of types ofgesture operations and the plurality of types of virtual keyboards.

In a possible design, when the one or more processors 10 execute the oneor more programs 401, the electronic device is further enabled toperform the following operation: obtaining a first gesture parametercorresponding to the first gesture operation. The first gestureparameter includes any one or more of the following parameters: locationinformation of a contact point corresponding to the first gestureoperation, quantity information of the contact point corresponding tothe first gesture operation, area information of the contact pointcorresponding to the first gesture operation, relative angle informationof a hand corresponding to the first gesture operation, locationinformation of the hand corresponding to the first gesture operation,quantity information of the hand corresponding to the first gestureoperation, and shape information of the hand corresponding to the firstgesture operation. When the one or more processors 10 execute the one ormore programs 401, the electronic device is enabled to specificallyperform the following operation: selecting, based on the first gestureparameter, the first type of virtual keyboard from the plurality oftypes of virtual keyboards.

In a possible design, when the one or more processors 10 execute the oneor more programs 401, the electronic device is further enabled toperform the following operation: obtaining a first angle in response tothe first gesture operation. The first angle indicates a relative anglebetween the hand corresponding to the first gesture operation and a sideof the display 50. Alternatively, the first angle indicates a relativeangle between the hand corresponding to the first gesture operation anda center line of the display 50. When the one or more processors 10execute the one or more programs 401, the electronic device is enabledto specifically perform the following operations: obtaining a displayangle of the first type of virtual keyboard based on the first angle,and displaying the first type of virtual keyboard based on the displayangle by using the display 50. The display angle indicates a relativeangle between a side of the first type of virtual keyboard and the sideof the display 50. Alternatively, the display angle indicates a relativeangle between a side of the first type of virtual keyboard and thecenter line of the display 50.

In a possible design, different types of virtual keyboards in theplurality of types of virtual keyboards have different functions. Thevirtual keyboards with different functions include a combination of anytwo or more types of the following virtual keyboards: a numerickeyboard, a function key keyboard, a full-size keyboard, and a customkeyboard. The function key keyboard is formed by function keys.

In a possible design, if the first gesture operation is a one-handoperation, the first type of virtual keyboard is any one type of thefollowing virtual keyboards: a mini keyboard, a numeric keyboard, afunction keyboard, a function key keyboard, a round keyboard, an arckeyboard, and a custom keyboard. The mini keyboard includes 26 alphabetkeys. The function keyboard is displayed in an application 401. Avirtual key included on the function keyboard corresponds to a functionof the application 401.

In a possible design, if the first gesture operation is a two-handoperation, the first type of virtual keyboard is a full-size keyboard,and the full-size keyboard includes at least 26 alphabet keys; and whenthe one or more processors 10 execute the one or more programs 401, theelectronic device is enabled to specifically perform the followingoperation: if a distance between two hands is less than or equal to afirst distance threshold, displaying the full-size keyboard in anintegrated manner by using the display 50; or if a distance between twohands is greater than a first distance threshold, displaying a firstsub-keyboard by using a second region on the display 50, and a secondsub-keyboard by using a third region on the display 50. The secondregion and the third region are different regions of the display 50, andthe first sub-keyboard and the second sub-keyboard include differentvirtual keys on the full-size keyboard.

In a possible design, the one-hand operation includes a left-handoperation and a right-hand operation. If the first gesture operation isthe right-hand operation, the first type of virtual keyboard is thenumeric keyboard; or if the first gesture operation is the left-handoperation, the first type of virtual keyboard is the function keyboard.

In a possible design, the display 50 is provided with a plurality ofvibration feedback elements. The location of the first type of virtualkeyboard on the display 50 is fixed in the process of displaying thefirst type of virtual keyboard. When the one or more processors 10execute the one or more programs 401, the electronic device is furtherenabled to perform the following operations: detecting a first contactoperation acting on the display 50; obtaining, in response to the firstcontact operation, first location information of a first contact pointcorresponding to the first contact operation, where the first locationinformation corresponds to a first virtual key on the virtual keyboard;if the first virtual key is an anchor point key, obtaining a firstvibration feedback element from the plurality of vibration feedbackelements, where the first vibration feedback element is a vibrationfeedback element that matches the first virtual key; and indicating thefirst vibration feedback element to emit a vibration wave, to perform afirst feedback operation, where the first feedback operation is used toprompt that the first virtual key is an anchor point key.

It should be noted that content such as information exchange and anexecution process between the modules/units in the electronic device 1is based on a same concept as the method embodiments corresponding toFIG. 17 to FIG. 38 in this application. For specific content, refer tothe descriptions in the foregoing method embodiments in thisapplication. Details are not described herein again.

An embodiment of this application further provides an electronic device.FIG. 40 is a schematic diagram of a structure of an electronic deviceaccording to an embodiment of this application. The electronic device 1may be specifically represented as a mobile phone, a tablet computer, anotebook computer, another device provided with a display, or the like.This is not limited herein. The electronic device described in theembodiment corresponding to FIG. 39 may be deployed on the electronicdevice 1 and is configured to implement a function of the electronicdevice in the embodiments corresponding to FIG. 17 to FIG. 38 .Specifically, the electronic device 1 may vary greatly with aconfiguration or performance, and may include one or more centralprocessing units (CPU) 1522 (for example, one or more processors), amemory 40, and one or more storage media 1530 (for example, one or moremass storage devices) that store an application 1542 or data 1544. Thememory 40 and the storage medium 1530 may be for temporary storage orpermanent storage. The program stored in the storage medium 1530 mayinclude one or more modules (which are not shown in the figure), andeach module may include a series of instruction operations on theelectronic device. Further, the central processing unit 1522 may beconfigured to communicate with the storage medium 1530, and perform, onthe electronic device 1, the series of instruction operations in thestorage medium 1530.

The electronic device 1 may further include one or more power supplies1526, one or more wired or wireless network interfaces 1550, one or moreinput/output interfaces 1558, and/or one or more operating systems 1541,for example, Windows Server™, Mac OS X™, Unix™, Linux™, and FreeBSD™.

In this embodiment of this application, the central processing unit 1522is configured to implement a function of the electronic device in theembodiments corresponding to FIG. 17 to FIG. 38 . It should be notedthat, for a specific embodiment in which the central processing unit1522 performs the function of the electronic device in the embodimentscorresponding to FIG. 17 to FIG. 38 and a beneficial effect of thefunction, refer to the descriptions in the method embodimentcorresponding to FIG. 17 to FIG. 38 . Details are not described hereinagain.

An embodiment of this application further provides a computer-readablestorage medium. The computer-readable storage medium stores a computerprogram. When the program is run on a computer, the computer is enabledto perform the operations performed by the electronic device in themethod described in the embodiments shown in FIG. 17 to FIG. 38 .

An embodiment of this application further provides a computer program.When the computer program is run on a computer, the computer is enabledto perform the operations performed by the electronic device in themethod described in the embodiments shown in FIG. 17 to FIG. 38 .

An embodiment of this application further provides a circuit system. Thecircuit system includes a processing circuit, and the processing circuitis configured to perform the operations performed by the electronicdevice in the method described in the embodiments shown in FIG. 17 toFIG. 38 .

The electronic device provided in this embodiment of this applicationmay be specifically a chip. The chip includes a processing unit and acommunication unit. The processing unit may be, for example, aprocessor. The communication unit may be, for example, an input/outputinterface, a pin, or a circuit. The processing unit may execute computerexecutable instructions stored in a storage unit, so that the chipperforms the operations performed by the electronic device in the methoddescribed in the embodiments shown in FIG. 17 to FIG. 38 . Optionally,the storage unit is a storage unit in the chip, for example, a registeror a cache; or the storage unit may be a storage unit that is in a radioaccess device and that is located outside the chip, for example, aread-only memory (ROM), another type of static storage device that canstore static information and instructions, or a random access memory(RAM).

The processor mentioned anywhere above may be a general-purpose centralprocessing unit, a microprocessor, an ASIC, or one or more integratedcircuits that are configured to control program execution of the methodaccording to the first aspect.

In addition, it should be noted that the described apparatus embodimentsare only examples. The units described as separate parts may or may notbe physically separate, and parts displayed as units may or may not bephysical units, may be located in one location, or may be distributed ona plurality of network units. Some or all of the modules may be selectedbased on actual requirements to achieve the objectives of the solutionsin embodiments. In addition, in the accompanying drawings of theapparatus embodiments provided by this application, connectionrelationships between modules indicate that the modules havecommunication connections with each other, which may be specificallyimplemented as one or more communication buses or signal cables.

Based on the description of the foregoing embodiments, a person skilledin the art may clearly understand that this application may beimplemented by software in addition to necessary universal hardware, orcertainly may be implemented by dedicated hardware, including adedicated integrated circuit, a dedicated CLU, a dedicated memory, adedicated component, and the like. Usually, any function implemented bya computer program may be easily implemented by using correspondinghardware. In addition, specific hardware structures used to implement asame function may be various, for example, an analog circuit, a digitalcircuit, or a dedicated circuit. However, in this application, asoftware program embodiment is a better embodiment in most cases. Basedon such an understanding, the technical solutions of this applicationessentially or the part contributing to the conventional technology maybe implemented in a form of a software product. The computer softwareproduct is stored in a readable storage medium, such as a floppy disk, aUSB flash drive, a removable hard disk, a ROM, a RAM, a magnetic disk,or an optical disc of a computer, and includes several instructions forinstructing a computer device (which may be a personal computer, aserver, or a network device) to perform the methods described inembodiments of this application.

All or some of the foregoing embodiments may be implemented by software,hardware, firmware, or any combination thereof. When software is used toimplement the foregoing embodiments, all or some of the embodiments maybe implemented in a form of a computer program.

The computer program includes one or more computer instructions. Whenthe computer program instructions are loaded and executed on a computer,the procedures or functions according to embodiments of this applicationare all or partially generated. The computer may be a general-purposecomputer, a dedicated computer, a computer network, or anotherprogrammable apparatus. The computer instructions may be stored in acomputer-readable storage medium or may be transmitted from acomputer-readable storage medium to another computer-readable storagemedium. For example, the computer instructions may be transmitted from awebsite, computer, server, or data center to another website, computer,server, or data center in a wired (for example, a coaxial cable, anoptical fiber, or a digital subscriber line (DSL)) or wireless (forexample, infrared, radio, or microwave) manner. The computer-readablestorage medium may be any usable medium accessible to a computer, or adata storage device integrating one or more usable media, for example, aserver or a data center. The usable medium may be a magnetic medium (forexample, a floppy disk, a hard disk, or a magnetic tape), an opticalmedium (for example, a DVD), a semiconductor medium (for example, asolid state drive (SSD)), or the like.

Embodiment 3

An application interface processing method provided in this embodimentof this application may be applied to an electronic device shown in FIG.41 . FIG. 41 is a schematic diagram of a structure of the electronicdevice according to an embodiment of this application. The electronicdevice includes a first display 501 and a first display 502. Adifference between the first display 501 and the first display 502 liesin that: The first display 502 is a display configured to obtainhandwriting input of a user, and the first display 501 is not a displayconfigured to obtain handwriting input by the user. In this case, thefirst display 502 is a touchscreen, and the first display 502 needs tohave both functions of receiving input and displaying output. It shouldbe understood that, FIG. 41 shows an example in which the electronicdevice includes only one first display 501 and one first display 502.However, in an actual case, one electronic device may further include atleast two first displays 501, or include at least two first displays502. A specific quantity of first displays 501 and first displays 502included in the electronic device may be determined based on an actualapplication scenario, and is not limited herein.

In an embodiment, the electronic device is preconfigured with at leasttwo displays, including the display (namely, the second display)configured to obtain handwriting input by the user and the display(namely, the first display) not configured to obtain handwriting inputby the user. In this way, the user may place the preset second displayat a location convenient for handwriting by the user.

In another embodiment, the electronic device determines, based on aplacement direction of each of the at least two included displays, thedisplay (namely, the second display) configured to obtain handwritinginput by the user and the display (namely, the first display) notconfigured to obtain handwriting input by the user. Specifically, theelectronic device may obtain an included angle between a placement angleof each of the at least two displays and a horizontal direction, andthen the electronic device may select, from the at least two includeddisplays, a display that has a smallest included angle with thehorizontal direction as the first display 502, and use a remainingdisplay in the at least two displays as the first display 501.Alternatively, the electronic device may select, from the at least twodisplays included in the electronic device, at least one display whoseincluded angle with the horizontal direction is less than a first anglethreshold as the first display 502, and use a remaining display in theat least two displays as the first display 501. The first anglethreshold may be 25 degrees, 30 degrees, 40 degrees, another value, orthe like, and is not exhaustively described herein.

Further, in one case, the first display 501 and the first display 502may be screens independent of each other, and the first display 501 andthe first display 502 are connected through a data interface.Alternatively, the first display 501 and the first display 502 areconnected through a bus. In another case, the first display 501 and thefirst display 502 are integrated in one flexible screen, and the firstdisplay 501 and the first display 502 are two different regions in theflexible screen.

Optionally, the electronic device may be further provided with anelectronic pen. The electronic pen may be specifically an electronic penusing an electromagnetic touchscreen technology (EMR), an electronic penusing an active electrostatic solution (AES) technology, another type ofelectronic pen, or the like. This is not limited herein.

Based on the electronic device shown in FIG. 41 , the followingdescribes an application scenario of this embodiment of thisapplication. For example, in an application scenario in which a studenttakes a note in a class, in a process of typing and taking the note byusing a virtual keyboard (in other words, a current applicationinterface is in a keyboard input mode), the student may need to use ahandwriting input mode, to draw a schematic diagram on a blackboard. Foranother example, in a process in which the user browses a novel or apicture (in other words, a current application interface is in abrowsing mode), the user may need to use a handwriting input mode, toadd an annotation to the novel or the picture. For still anotherexample, in a process in which the user writes a report by using avirtual keyboard (in other words, a current application interface is ina keyboard input mode), the user may suddenly need to draw an idea witha pen (in other words, a current application interface needs to use ahandwriting input mode). The application scenario of this embodiment ofthis application is not exhaustively described herein. In the foregoingvarious scenarios, an operation is complex in a handwriting inputprocess.

To resolve the foregoing problem, an embodiment of this applicationprovides an application interface processing method. The applicationinterface processing method is applied to the electronic device shown inFIG. 41 . The electronic device displays a first application interfaceby using the first display. If the electronic device detects that a modetype corresponding to a first application interface is changed tohandwriting input, the electronic device triggers, in response to thehandwriting input mode, display of the first application interface onthe second display, to obtain handwriting input content for the firstapplication interface by using the second display. In other words, inthe case in which the electronic device detects that the current modetype corresponding to the first application interface is the handwritinginput mode, the electronic device automatically displays the firstapplication interface on the second display, to directly obtain thehandwriting input content for the first application interface by usingthe second display. That is, another mode can be directly switched tothe handwriting input mode without performing operations such as copyingand pasting. This avoids complex operations and greatly improveshandwriting input efficiency.

Further, in some application scenarios, one application interface can beswitched only between the keyboard input mode and the handwriting inputmode. In another application scenario, one application interface can beswitched only between the keyboard input mode and the browsing mode.Because specific embodiment procedures are different in the foregoingtwo application scenarios, the following separately describes thespecific embodiment procedures.

1. Switching Between the Keyboard Input Mode and the Handwriting InputMode.

In this embodiment of this application, FIG. 42A and FIG. 42B show aschematic flowchart of the application interface processing methodaccording to an embodiment of this application. The applicationinterface processing method provided in this embodiment of thisapplication may include the following operations.

4201: The electronic device obtains a start operation for the firstapplication interface.

In this embodiment of this application, the electronic device obtainsthe start operation for the first application interface. A targetapplication (APP) may include one or more application interfaces. Thefirst application interface means any of at least one applicationinterface included in the target application. That is, the firstapplication interface may be an interface that appears when the targetapplication is started, or may be a new interface that is opened in aprocess of using the target application.

Specifically, operation 4201 may include: The electronic device obtainsthe start operation for the first application interface by using thefirst display, or the electronic device obtains the start operation forthe first application interface by using the second display. Further,the electronic device obtains the start operation for the firstapplication interface by using an electronic pen, a mouse, or a finger.

4202: The electronic device determines, based on the start operation,the mode type corresponding to the first application interface.

In some embodiments of this application, the electronic devicedetermines, based on the obtained start operation, the mode typecorresponding to the first application interface. The mode typecorresponding to the first application interface is handwriting input orkeyboard input.

In an embodiment, the electronic device determines, based on anobtaining location corresponding to the start operation, the mode typecorresponding to the first application interface. Specifically, in thecase in which the start operation is obtained by using the firstdisplay, it may be proved that the user usually displays the firstapplication interface on the first display. In this case, the electronicdevice determines that the mode type corresponding to the firstapplication interface is keyboard input. In other words, an initial modetype of the first application interface is keyboard input. In the casein which the start operation is obtained by using the second display, itis proved that the user usually uses the first application interface onthe second display. In this case, the electronic device determines thatthe mode type corresponding to the first application interface ishandwriting input. In other words, an initial mode type of the firstapplication interface is handwriting input. For a difference between thefirst display and the second display, refer to the foregoing descriptionof FIG. 41 . Details are not described herein again.

In this embodiment of this application, the mode type corresponding tothe first application interface is determined based on the location ofthe start operation obtained by the electronic device. This is simple inoperation and easy to implement.

In another embodiment, the electronic device determines, based on astart manner corresponding to the start operation, the mode typecorresponding to the first application interface. Specifically, if thestart operation is obtained by using the electronic pen, the electronicdevice determines that the mode type corresponding to the firstapplication interface is handwriting input. For example, if theelectronic device obtains that the user taps an application icon of thetarget application by using the electronic pen to open the firstapplication interface, the electronic device may determine that the modetype corresponding to the first application interface is handwritinginput. If the start operation is obtained by using the mouse or thefinger, the electronic device determines that the mode typecorresponding to the first application interface is keyboard input.

This embodiment of this application provides still another embodiment ofdetermining, based on the start operation, the mode type correspondingto the first application interface. This helps improve embodimentflexibility of this solution, and is easy to implement and operate.

In another embodiment, the electronic device may determine, based on theobtaining location corresponding to the start operation and the startmanner corresponding to the start operation, the mode type correspondingto the first application interface. Specifically, in one case in whichthe start operation is obtained by using the electronic pen, or thestart operation is obtained by using the second display, the electronicdevice determines that the mode type corresponding to the firstapplication interface is handwriting input. If the start operation isobtained by using the mouse or the finger, and the start operation isobtained by using the first display, the electronic device determinesthat the mode type corresponding to the first application interface iskeyboard input.

In one case in which the start operation is obtained by using theelectronic pen and the second display, the electronic device determinesthat the mode type corresponding to the first application interface ishandwriting input. If the start operation is obtained by using the mouseor the finger, or the start operation is obtained by using the firstdisplay, the electronic device determines that the mode typecorresponding to the first application interface is keyboard input.

It should be noted that, the electronic device may alternativelydetermine the initial mode type of the first application interface inanother manner, and details are not described one by one herein.

4203: The electronic device determines whether the mode typecorresponding to the first application is handwriting input. If the modetype corresponding to the first application is keyboard input, operation4204 is performed; or if the mode type corresponding to the firstapplication is handwriting input, operation 4211 is performed.

4204: The electronic device triggers, in response to the keyboard inputmode, display of the first application interface on the first display,and display of the virtual keyboard on the second display.

In this embodiment of this application, if the electronic devicedetermines that the mode type corresponding to the first applicationinterface is not handwriting input but keyboard input, the electronicdevice triggers, in response to the keyboard input mode, display of thefirst application interface on the first display, and display of thevirtual keyboard on the second display, to obtain input content for thefirst application interface by using the virtual keyboard on the seconddisplay.

Further, if a receiving interface of handwriting input of anotherapplication interface is further displayed on the second display whenthe virtual keyboard is displayed on the second display, in anembodiment, the electronic device may set, on a top or at a bottom ofthe second display, a start icon that is in a one-to-one correspondencewith each application, to switch between the virtual keyboard displayedon the second display and the another application interface. For moreintuitive understanding of this solution, refer to FIG. 43 . FIG. 43shows a schematic interface diagram of a display interface of the seconddisplay in the application interface processing method according to anembodiment of this application. FIG. 43 shows a start icon of anapplication interface 1, a start icon of an application interface 2, andthe display interface (corresponding to the first application interfaceshown on the first display) of the virtual keyboard, so that the usercan switch between the virtual keyboard and the application interface 1by tapping the start icon of the application interface 1. The user canswitch between the virtual keyboard and the application interface 2 bytapping the start icon of the application interface 2. It should beunderstood that the example in FIG. 43 is only for ease of understandingof this solution, and is not intended to limit this solution.

In another embodiment, the electronic device may further set zoom iconson the display interface of the virtual keyboard on the second display.When the user taps a zoom-out icon with the electronic pen, the finger,the mouse, or the like, the virtual keyboard displayed on the seconddisplay is collapsed. When the user taps a zoom-in icon by using thepen, the finger, the mouse, or the like, the virtual keyboard displayedon the second display is expanded. In another embodiment, the user mayfurther switch between the virtual keyboard displayed on the seconddisplay and the another application interface by inputting a slideoperation on the second display. The slide operation may be a slideoperation in a left-right direction, a slide operation in an up-downdirection, or the like. The electronic device may further switch betweenthe virtual keyboard and the another application interface in anothermanner, which is not exhaustively described herein.

For more intuitive understanding of this solution, refer to FIG. 44 andFIG. 45 . FIG. 44 and FIG. 45 separately show schematic flowcharts ofthe application interface processing method according to an embodimentof this application. First refer to FIG. 44 . FIG. 44 includes twoschematic subdiagrams (a) and (b). In the schematic subdiagram (a) inFIG. 44 , the electronic device obtains the start operation for thetarget application (namely, an application “Note” in the figure) byusing the first display. Because the start operation is input by usingthe first display, the electronic device determines that the mode typecorresponding to the first application interface is keyboard input, andthe electronic device displays the schematic subdiagram (b) in FIG. 44 .The electronic device displays the first application interface (namely,an initial application interface of the application “Note”) on the firstdisplay, and displays the virtual keyboard and a touchpad region on thesecond display.

Still refer to FIG. 45 . FIG. 45 includes two schematic subdiagrams (a)and (b). In the schematic subdiagram (a) in FIG. 45 , the electronicdevice obtains the start operation for the target application (namely,an application “Note” in the figure) by using the first display. Becausethe start operation is obtained by using the finger, the electronicdevice determines that the mode type corresponding to the firstapplication interface is keyboard input, and the electronic devicedisplays the schematic subdiagram (b) in FIG. 45 . The electronic devicedisplays the first application interface on the first display, anddisplays the virtual keyboard and the touchpad region on the seconddisplay. It should be noted that the second displays in FIG. 44 and FIG.45 may display only the virtual keyboard, but not the touchpad region.It should be understood that examples in FIG. 44 and FIG. 45 are onlyfor ease of understanding of this solution, and are not intended tolimit this solution.

Optionally, operation 4204 may include: displaying the virtual keyboardand an application control bar on the second display. The method mayfurther include: The electronic device detects a second operation actingon the second display; in response to the second operation, changes afirst display area of the application control bar to a second displayarea, and changes a first control key group included in the applicationcontrol bar to a second control key group. Both the first control keygroup and the second control key group are control key setscorresponding to a target application. Specific meaning of the nouns inthe foregoing operations and specific embodiments of the foregoingoperations are all described in the following Embodiment 4. Details arenot described herein again.

Optionally, the first application interface includes a first controlkey, and operation 4204 may include: displaying the virtual keyboard andthe application control bar on the second display. The method mayfurther include: The electronic device detects a second operation on thefirst target application interface; and in response to the secondoperation, displays the first control key in the application controlbar, and hides the first control key in the first application interface.Specific meaning of the nouns in the foregoing operations and specificembodiments of the foregoing operations are all described in thefollowing Embodiment 4. Details are not described herein again.

Optionally, operation 4204 may include: The electronic device displays asecond type of virtual keyboard (which may also be referred to as adefault type of virtual keyboard) on the second display. The methodfurther includes: The electronic device detects a first gestureoperation acting on the second display, and selects, in response to thedetected first gesture operation, a first type of virtual keyboardcorresponding to the first gesture operation from a plurality of typesof virtual keyboards. Virtual keys included in different types ofvirtual keyboards in the plurality of types of virtual keyboards are notcompletely the same. The electronic device displays the first type ofvirtual keyboard by using the second display. The first type of virtualkeyboard and the second type of virtual keyboard are different types ofvirtual keyboards in the plurality of types of virtual keyboards. Inother words, after the electronic device displays the second type ofvirtual keyboard on the second display, the user may change, byinputting a different gesture operation, a type of the virtual keyboarddisplayed on the second display. For meaning of the nouns such as thefirst gesture operation and the different types of virtual keyboards,and specific embodiments of the foregoing operations, refer todescriptions in Embodiment 2. Details are not described herein again.

4205: The electronic device obtains the mode type corresponding to thefirst application interface.

In this embodiment of this application, after the electronic deviceopens the first application interface, that is, in a running process ofthe first application interface, the electronic device further detectsand obtains, in real time, the mode type corresponding to the firstapplication interface, to determine whether the mode type correspondingto the first application interface changes. Specifically, if theelectronic device can detect a first operation, the mode typecorresponding to the first application interface is changed tohandwriting input in response to the first operation; if the electronicdevice does not detect the first operation, the mode type correspondingto the first application interface is keyboard input, and the electronicdevice continuously detects and obtains the mode type corresponding tothe first application interface.

More specifically, in an embodiment, the electronic device determines,based on a posture of holding the electronic pen by the user, the modetype corresponding to the first application interface. Specifically, inone case, the electronic device prestores a first preset condition, andthe electronic device obtains, in real time, the posture of holding theelectronic pen by the user, and determines whether the posture ofholding the electronic pen by the user meets the first preset condition.If the posture of holding the electronic pen by the user meets the firstpreset condition, the electronic device determines that the firstoperation of the user is detected, and changes the mode typecorresponding to the first application interface to the handwritinginput mode. If the posture of holding the electronic pen by the userdoes not meet the first preset condition, the electronic devicedetermines that the mode type corresponding to the first applicationinterface is the keyboard input mode.

The holding posture includes any one or a combination of the following:a holding location, holding force, a holding angle, anotherholding-related factor, or the like. This is not limited herein. Thefirst preset condition includes any one or a combination of thefollowing: The holding location falls within a first location range, theholding force falls within the first force range, the holding anglefalls within the first angle range, another preset condition, or thelike.

In this embodiment of this application, in addition to writing, theelectronic pen may further perform another operation, for example,perform some operations performed by using the mouse, such as a slideoperation and a selection operation. Alternatively, the user may onlyunconsciously hold the electronic pen, and does not want to perform awriting operation or the like, which is not exhaustively describedherein. The electronic device does not roughly determine that once theuser uses the electronic pen, the mode type corresponding to the firstapplication is a writing mode, but further determines, based on theposture of holding the electronic pen by the user, the mode typecorresponding to the first application interface. This can reduce anerror rate in a process of determining the mode type corresponding tothe first application interface, reduce a probability of incorrectlyplacing the first application interface, avoid waste of computerresources, and enhance user viscosity.

Further, the electronic pen may be configured in the electronic device.After the electronic pen is taken out by the user from the electronicdevice, a communication interface may be configured between theelectronic pen and the electronic device. The electronic pen maycollect, in real time, a holding parameter corresponding to the holdingposture, and send the holding parameter to the electronic device, sothat the electronic device determines whether the posture of holding theelectronic pen by the user meets the first preset condition. The holdingparameter includes any one or a combination of the following: a locationof a contact point corresponding to a holding operation, holding force,a tilt angle of the electronic pen, another parameter, or the like.

A tactile sensing module may be disposed in the electronic pen. Thetactile sensing module of the electronic pen collects a location of eachcontact point between the user and the electronic pen in real time (thatis, determines a location at which the user holds the electronic pen),and sends the location of each contact point to the electronic device.The electronic device determines, based on the location of each contactpoint, whether the location at which the user holds the electronic penfalls within a first location range. The tactile sensing module may bespecifically represented as a tactile sensing film. The tactile sensingfilm may be specifically a capacitive tactile sensing film, a pressuretactile sensing film, a temperature tactile sensing film, another typeof film, or the like, which is not exhaustively described herein.

A pressure sensing module may be disposed in the electronic pen. Thepressure sensing module of the electronic pen collects, in real time,force of holding the electronic pen by the user, and sends the force ofholding the electronic pen by the user to the electronic device, so thatthe electronic device determines whether the force of holding theelectronic pen by the user falls within the first force range. Thepressure sensing module may be specifically represented as a pressuresensing film, a distributed pressure sensor, or another form, which isnot exhaustively described herein.

An angle measurement module may be disposed in the electronic pen. Theangle measurement module of the electronic pen collects the tilt angleof the electronic pen in real time (that is, determines an angle atwhich the user holds the electronic pen), and sends the tilt angle ofthe electronic pen to the electronic device. The electronic devicedetermines whether the angle at which the user holds the electronic penfalls within the first angle range. The angle measurement module may bespecifically represented as a gyroscope, another type of anglemeasurement module, or the like. This is not limited herein.

Still further, in an embodiment, the electronic device may record inadvance a posture of holding the electronic pen by the user duringhandwriting input, and further determine the first preset conditionbased on the holding posture recorded by the user. Optionally, theelectronic device may further collect a posture of holding theelectronic pen by the user in a writing process, that is, collect alocation of a contact point between the finger of the user and theelectronic pen, holding force of the user, a tilt angle of theelectronic pen, and the like, to adjust the first preset condition. Inanother embodiment, the first preset condition in the electronic devicemay be preset.

For more intuitive understanding of this solution, refer to FIG. 46 .FIG. 46 is a schematic diagram of various holding postures in anapplication interface processing method according to an embodiment ofthis application. FIG. 46 shows six schematic subdiagrams (a), (b), (c),(d), (e), and (f). The schematic subdiagrams (a), (b), (c), and (d) inFIG. 46 separately show four postures of holding the electronic pen bythe user for writing. The schematic subdiagrams (e) and (f) in FIG. 46show two gestures of holding the electronic pen by the user not forwriting. It should be understood that the example in FIG. 46 is only forease of understanding of a concept of the posture of holding theelectronic pen by the user, and is not intended to limit this solution.

In another embodiment, the electronic device may set, on the firstapplication interface or the display interface of the virtual keyboard,a trigger icon that is in a one-to-one correspondence with each of thekeyboard input mode and the handwriting input mode. When the user tapsthe handwriting input icon on the first application interface, theelectronic device can obtain a trigger instruction for handwritinginput, in other words, the electronic device detects the first operationof the user. When the user taps the keyboard input icon on the firstapplication interface, the electronic device can obtain a triggerinstruction for keyboard input. Alternatively, a switching icon forswitching between the keyboard input mode and the handwriting input modemay be set on the first application interface of the electronic device.When the switching icon is in a first state, it is considered that theuser inputs a trigger operation for handwriting input. When theswitching icon is in a second state, it is considered that the userinputs a trigger operation for keyboard input, and the like. The mannerof obtaining the trigger instruction for handwriting input by theelectronic device is not exhaustively described herein. In response tothe trigger instruction for handwriting input, the electronic devicedetermines that the mode type corresponding to the first applicationinterface is the handwriting input mode.

For more intuitive understanding of this solution, refer to FIG. 47 andFIG. 48 . FIG. 47 is a schematic diagram of one type of firstapplication interface in the application interface processing methodaccording to an embodiment of this application. FIG. 48 is a schematicdiagram of two types of first application interfaces in the applicationinterface processing method according to an embodiment of thisapplication. First refer to FIG. 47 . Two icons are set on the firstapplication interface. C1 represents a trigger icon corresponding to thekeyboard input mode, and C2 represents a trigger icon corresponding tothe handwriting input mode. Therefore, when the user taps C2 on thefirst application interface, the electronic device can obtain thetrigger instruction for handwriting input.

Still refer to FIG. 48 . FIG. 48 includes two schematic subdiagrams (a)and (b). In the schematic subdiagram (a) and the schematic subdiagram(b) in FIG. 48 , D1 represents a switching icon for switching betweenthe keyboard input mode and the handwriting input mode. In the schematicsubdiagram (a) in FIG. 48 , the switching icon is in a first state, andthe mode type corresponding to the first application interface is thekeyboard input mode. In the schematic subdiagram (b) in FIG. 48 , theswitching icon is in a second state, and the mode type corresponding tothe first application interface is the handwriting input mode. It shouldbe understood that examples in FIG. 47 and FIG. 48 are only for ease ofunderstanding of this solution, and are not intended to limit thissolution.

In another embodiment, the electronic device may further obtain, byusing the first application interface displayed on the first display orby using the interface of the virtual keyboard displayed on the seconddisplay, the first contact operation that is input by the user. If thefirst contact operation is detected, the electronic device determinesthat the first operation is detected, and further changes the mode typecorresponding to the first application interface to the handwritinginput mode. The first contact operation is a tap operation or a presettrack operation. Further, the first contact operation may be a tapoperation, a double-tap operation, a triple-tap operation, a touch andhold operation, a “Z”-shaped track operation, a slide down operation, a“tick”-shaped track operation, a “circle”-shaped track operation,another contact operation, or the like, which is not exhaustivelydescribed herein.

Further, operation 4205 may include: The electronic device obtains aslide operation in a first direction by using the second display. Theslide operation in the first direction is a slide operation of slidingfrom an upper side of the second display to a lower side of the seconddisplay. A distance between the upper side of the second display and thefirst display is shorter than a distance between the lower side of thesecond display and the first display. In response to the slide operationin the first direction, the virtual keyboard displayed on the seconddisplay is moved in the first direction toward the lower side of thesecond display. When an upper side of the virtual keyboard reaches thelower side of the second display, the electronic device determines thatthe mode type corresponding to the first application interface ischanged to handwriting input. In this embodiment of this application,the virtual keyboard displayed on the second display can accompany aslide down operation of the user. When the upper side of the virtualkeyboard reaches the lower side of the second display, the electronicdevice determines that the mode type corresponding to the firstapplication interface is changed to handwriting input. This increasesinterest in a process of changing from keyboard input to handwritinginput, and helps enhance user viscosity.

For more intuitive understanding of this solution, refer to FIG. 49 .FIG. 49 is a schematic diagram of the first contact operation in theapplication interface processing method according to an embodiment ofthis application. FIG. 49 includes three schematic subdiagrams (a), (b),and (c). FIG. 49 shows an example in which the first contact operationis a slide down operation input by using the second display. As shown inthe schematic subdiagram (a) in FIG. 49 and the schematic subdiagram (b)in FIG. 49 , when the user inputs the slide down operation by using thedisplay interface of the virtual keyboard on the second display, thevirtual keyboard on the second display is folded. When the virtualkeyboard on the second display is completely folded, it is consideredthat the first contact operation is obtained by using the seconddisplay, and the electronic device determines that the mode typecorresponding to the first application interface is the handwritinginput mode. Then, the schematic subdiagram (c) in FIG. 49 is triggeredto be displayed. In other words, the first application interface istriggered to be displayed on the second display. It should be understoodthat the example in FIG. 49 is only for ease of understanding of thissolution, and is not intended to limit this solution.

In another embodiment, in the process of displaying the firstapplication interface by using the first display, the electronic devicemay detect a distance between the electronic pen and the second displayin real time. If the electronic pen is located in a preset range of thesecond display, the electronic device determines that the firstoperation is detected, and changes the mode type corresponding to thefirst application interface to the handwriting input mode. The presetrange of the second display may be within 3 cm, 4 cm, 5 cm, anotherrange, or the like that is exactly above the second display. This is notlimited herein.

In another embodiment, the electronic device may collect a state of theelectronic pen in real time. If the electronic pen changes from a firstpreset state to a second preset state, the electronic device determinesthat the first operation is detected, and changes the mode typecorresponding to the first application interface to the handwritinginput mode. If the electronic pen is not in a second preset state, theelectronic device determines that the mode type corresponding to thefirst application interface is the keyboard input mode. That theelectronic pen changes from a first preset state to a second presetstate may be that the electronic pen changes from a static state to amoving state, the electronic pen changes from an unheld state to a heldstate, or the like, which is not exhaustively described herein.

For example, after the user opens the first application interface, inthe process of displaying the first application interface, the usertakes the electronic pen out of the electronic device (the electronicpen changes from an unheld state to a held state), or the user picks upthe electronic pen from a location outside the electronic device (theelectronic pen changes from an unheld state to a held state), and theelectronic device may determine that the mode type corresponding to thefirst application interface is the handwriting input mode.

Further, after the electronic pen is taken out of the electronic device,the electronic pen establishes a communication connection to theelectronic device. In this case, if the electronic device detects thatthe electronic pen changes from not establishing a communicationconnection to the electronic device to establishing a communicationconnection to the electronic device, it may be considered that theelectronic device changes from an unheld state to a held state.

A vibration sensor (for example, a gyro sensor, an acceleration sensor,or another type of sensor) may be configured in the electronic pen. Inthis way, the electronic device may collect vibration data of theelectronic pen in real time. The vibration data of the electronic pen issent to the electronic device in real time by using a communicationmodule. The electronic device determines whether the electronic penchanges from a static state to a moving state.

Taking the electronic pen out of the device may be sensed when aprocessing module of the device receives a signal indicating that thestylus is disconnected from an interface of the device or when a sensormodule of the stylus senses disconnection from the device and then sendsa disconnection signal to a screen device by using the communicationmodule. However, a process in which the user picks up the stylus issensed when the sensor module (such as a gyro sensor or an accelerationsensor) of the stylus senses vibration imposed on the stylus picked upby the user and then sends vibration data to a main device processingmodule by using the communication module.

In this embodiment of this application, a plurality of manners ofdetermining the mode type corresponding to the first applicationinterface are provided. This improves embodiment flexibility of thissolution and expands an application scenario of this solution. Further,the mode type corresponding to the first application interface isdetermined based on the holding posture of the electronic pen, so thatthe user can change the mode type of the first application interfacewithout performing another operation. In addition, the mode typecorresponding to the first application interface is determined based onthe posture of holding the electronic pen by the user. This can reducean error rate in a process of determining the mode type corresponding tothe first application interface, reduce a probability of incorrectlyplacing the first application interface, avoid waste of computerresources, and help enhance user viscosity.

4206: The electronic device determines whether the mode typecorresponding to the first application interface is changed tohandwriting input. If the mode type corresponding to the firstapplication interface is changed to handwriting input, operation 4207 isperformed; or if the mode type corresponding to the first applicationinterface is not changed to handwriting input, operation 4205 isperformed again.

In this embodiment of this application, after performing operation 4205,the electronic device performs operation 4206 to determine whether themode type corresponding to the first application interface is changedfrom the keyboard input mode to the handwriting input mode. If the modetype corresponding to the first application interface is changed tohandwriting input, operation 4207 is performed. If the mode typecorresponding to the first application interface is not changed tohandwriting input, operation 4205 is performed again, to continue todetect the mode type corresponding to the first application interface.It should be noted that in this embodiment of this application,operations 4205 and 4206 may intersect each other, and a relationship ofperforming times between operations 4205 and 4206 and operation 4207 isnot limited. Operation 4207 may be performed once after operations 4205and 4206 are performed for a plurality of times.

4207: The electronic device triggers, in response to the handwritinginput mode, display of the first application interface on the seconddisplay.

In this embodiment of this application, if the electronic device obtainsthat the mode type corresponding to the first application interfacechanges from the keyboard input mode to the handwriting input mode, inresponse to the handwriting input mode, the electronic device triggersdisplay of the first application interface on the second display,disables the virtual keyboard displayed on the second display, andobtains, by using the second display, handwriting content input by theuser for the first application interface. When the electronic devicedisplays the first application interface on the second display, theelectronic device may move the first application interface to the seconddisplay for displaying, or the electronic device automatically performsa copying operation on the first application interface, and thendisplays the first application interface by using the second display.

Specifically, an operating system runs on the electronic device. Theelectronic device may display the first application interface on thesecond display by invoking a move to function in the operating system,or by invoking a Set Window Position function in the operating system,or by invoking a Set Window Placement function in the operating system.

More specifically, in one case, there is no other application interfaceon the second display of the electronic device. In an embodiment, theelectronic device may disable the virtual keyboard displayed on thesecond display, move the first application interface to the seconddisplay (that is, not display the first application interface on thefirst display), and display the first application interface in a fullscreen mode by using the second display. In another embodiment, theelectronic device may disable the virtual keyboard displayed on thesecond display, and copy the first application interface to the seconddisplay, to display the first application interface on both the firstdisplay and the second display.

For more intuitive understanding of this solution, refer to FIG. 50 .FIG. 50 is a schematic diagram of a display interface of the firstapplication interface in the application interface processing methodaccording to an embodiment of this application. FIG. 50 includes twoschematic subdiagrams (a) and (b). The schematic subdiagram (a) in FIG.50 shows a schematic diagram of the first display and the second displayof the electronic device if the mode type corresponding to the firstapplication interface is the keyboard input mode. If the electronicdevice obtains that the mode type corresponding to the first applicationinterface is changed from the keyboard input mode to the handwritinginput mode, the schematic subdiagram (a) in FIG. 50 is triggered to beswitched into the schematic subdiagram (b) in FIG. 50 . That is, thevirtual keyboard displayed on the second display is disabled, and thefirst application interface is moved to the second display. It should benoted that, in addition to the first application interface, anotherapplication interface may be displayed on the first display of theelectronic device. The example herein is only for ease of understandingof this solution, and is not intended to limit this solution.

In another case, another application interface is further displayed onthe second display of the electronic device. In an embodiment, theelectronic device may disable the virtual keyboard displayed on thesecond display, and display the first application interface and theanother application interface on the second display in a matrix manner.In another embodiment, the electronic device may disable the virtualkeyboard displayed on the second display, and display the firstapplication interface on the second display in a form of a floatingwindow. In another embodiment, the electronic device may disable thevirtual keyboard displayed on the second display, and move the anotherapplication interface displayed on the second display to the firstdisplay, to display the first application interface, and the like in afull screen mode by using the second display. The manner of displayingthe first application interface on the second display is notexhaustively described herein.

Further, in the foregoing embodiments, when displaying the firstapplication interface on the second display, the electronic device mayfurther display the first application interface on the first display, ormay not display the first application interface on the first display.

Optionally, operation 4204 may include: displaying the first applicationinterface and the application control bar on the second display. Themethod may further include: The electronic device detects a secondoperation acting on the second display; in response to the secondoperation, changes a first display area of the application control barto a second display area, and changes a first control key group includedin the application control bar to a second control key group. Both thefirst control key group and the second control key group are control keysets corresponding to a target application. Specific meaning of thenouns in the foregoing operations and specific embodiments of theforegoing operations are all described in the following Embodiment 4.Details are not described herein again.

Optionally, the first application interface includes a first controlkey, and operation 4204 may include: displaying the first applicationinterface and the application control bar on the second display. Themethod may further include: The electronic device detects a secondoperation on the first target application interface; and in response tothe second operation, displays the first control key in the applicationcontrol bar, and hides the first control key in the first applicationinterface. Specific meaning of the nouns in the foregoing operations andspecific embodiments of the foregoing operations are all described inthe following Embodiment 4. Details are not described herein again.

4208: The electronic device obtains the mode type corresponding to thefirst application interface.

In this embodiment of this application, for a specific embodiment ofoperation 4208, refer to the foregoing description of operation 4205.Details are not described herein again.

4209: The electronic device determines whether the mode typecorresponding to the first application interface is changed to keyboardinput. If the mode type corresponding to the first application interfaceis changed to keyboard input, operation 4210 is performed; or if themode type corresponding to the first application interface is notchanged to keyboard input, operation 4208 is performed again.

In this embodiment of this application, after performing operation 4208,the electronic device performs operation 4209 to determine whether themode type corresponding to the first application interface is changedfrom the handwriting input mode to the keyboard input mode. If the modetype corresponding to the first application interface is changed tokeyboard input, operation 4210 is performed. If the mode typecorresponding to the first application interface is not changed tohandwriting input, operation 4208 is performed again, to continue todetect the mode type corresponding to the first application interface.It should be noted that in this embodiment of this application,operations 4208 and 4209 may intersect each other, and a relationship ofperforming times between operations 4208 and 4209 and operation 4209 isnot limited. Operation 4210 may be performed once after operations 4208and 4209 are performed for a plurality of times.

4210: The electronic device triggers, in response to the keyboard inputmode, display of the first application interface on the first display,and display of the virtual keyboard on the second display.

In this embodiment of this application, for a specific embodiment ofoperation 4210, refer to the foregoing description of operation 4204.Details are not described herein again. It should be noted that, afterperforming operation 4210, the electronic device may perform operation4205 again to detect in real time whether the mode type corresponding tothe first application interface is changed to handwriting input. Inaddition, operations 4205 to 4209 are all optional operations. If theuser closes the first application interface in any one of operations4205 to 4209, other operations do not need to be performed.

In this embodiment of this application, in the process of displaying theapplication interface, when the application interface is changed fromanother mode type to handwriting input, a layout of the applicationinterface on different displays of the electronic device can beautomatically adjusted. When the mode type of the application interfaceis changed to keyboard input, the layout of the application interface ondifferent displays of the electronic device can also be automaticallyadjusted, and the virtual keyboard can be automatically displayed. Inthis way, when the mode type of the application interface is changed tokeyboard input, the user does not need to manually adjust the layout ofthe application interface on different displays, but can directlyperform keyboard input. The operations are simple, and user viscosity inthis solution is further increased.

4211: The electronic device triggers, in response to the handwritinginput mode, display of the first application interface on the seconddisplay.

In this embodiment of this application, if the electronic devicedetermines that the mode type corresponding to the first applicationinterface is handwriting input, the electronic device triggers, inresponse to the handwriting input mode, display of the first applicationinterface on the second display, to obtain input content for the firstapplication interface by using the first display. For a manner ofdisplaying the first application interface on the second display, referto the descriptions in operation 4207. Details are not described hereinagain.

For more intuitive understanding of this solution, refer to FIG. 51 andFIG. 52 . FIG. 51 and FIG. 52 separately show schematic flowcharts ofthe application interface processing method according to an embodimentof this application. First refer to FIG. 51 . FIG. 51 includes twoschematic subdiagrams (a) and (b). In the schematic subdiagram (a) inFIG. 51 , the electronic device obtains the start operation for thetarget application (namely, an application “Note” in the figure) byusing the second display. Because the start operation is input by usingthe second display, the electronic device determines that the mode typecorresponding to the first application interface is handwriting input,and the electronic device displays the schematic subdiagram (b) in FIG.51 . The electronic device displays the first application interface(namely, an initial application interface of the application “Note”) onthe second display.

Still refer to FIG. 52 . FIG. 52 includes two schematic subdiagrams (a)and (b). In the schematic subdiagram (a) in FIG. 52 , the electronicdevice obtains the start operation for the target application (namely,an application “Note” in the figure) by using the first display. Becausethe start operation is obtained by using the electronic pen, theelectronic device determines that the mode type corresponding to thefirst application interface is handwriting input, and the electronicdevice displays the schematic subdiagram (b) in FIG. 52 . The electronicdevice displays the first application interface on the second display.It should be understood that examples in FIG. 51 and FIG. 52 are onlyfor ease of understanding of this solution, and are not intended tolimit this solution.

4212: The electronic device obtains the mode type corresponding to thefirst application interface.

4213: The electronic device determines whether the mode typecorresponding to the first application interface is changed to keyboardinput. If the mode type corresponding to the first application interfaceis changed to keyboard input, operation 4214 is performed; or if themode type corresponding to the first application interface is notchanged to keyboard input, operation 4212 is performed again.

4214: The electronic device triggers, in response to the keyboard inputmode, display of the first application interface on the first display,and display of the virtual keyboard on the second display.

In this embodiment of this application, for specific embodiments ofoperations 4212 to 4214, refer to the foregoing descriptions ofoperations 4208 to 4210. Details are not described herein again.

4215: The electronic device obtains the mode type corresponding to thefirst application interface.

4216: The electronic device determines whether the mode typecorresponding to the first application interface is changed tohandwriting input. If the mode type corresponding to the firstapplication interface is changed to handwriting input, operation 4217 isperformed; or if the mode type corresponding to the first applicationinterface is not changed to handwriting input, operation 4215 isperformed again.

4217: The electronic device triggers, in response to the handwritinginput mode, display of the first application interface on the seconddisplay.

In this embodiment of this application, for specific embodiments ofoperations 4215 to 4217, refer to the foregoing descriptions ofoperations 4205 to 4207. Details are not described herein again.

It should be noted that, after performing operation 4217, the electronicdevice may perform operation 4212 again to detect in real time whetherthe mode type corresponding to the first application interface ischanged to keyboard input. In addition, operations 4212 to 4217 are alloptional operations. If the user closes the first application interfacein any one of operations 4212 to 4217, other operations do not need tobe performed.

2. Switching Between the Handwriting Input Mode and the Browsing Mode.

In this embodiment of this application, refer to FIG. 53A and FIG. 53B.FIG. 53A and FIG. 53B show is a schematic flowchart of the applicationinterface processing method according to an embodiment of thisapplication. The application interface processing method provided inthis embodiment of this application may include the followingoperations.

5301: The electronic device obtains a start operation for the firstapplication interface.

5302: The electronic device determines, based on the start operation,the mode type corresponding to the first application interface.

5303: The electronic device determines whether the mode typecorresponding to the first application is handwriting input. If the modetype corresponding to the first application is a browsing mode,operation 5304 is performed; or if the mode type corresponding to thefirst application is handwriting input, operation 5311 is performed.

In this embodiment of this application, for specific embodiments ofoperations 5301 to 5303, refer to the descriptions of operations 4201 to4203 in the embodiment corresponding to 42A and FIG. 42B. A differencelies in that the keyboard input mode in operations 4201 to 4203 isreplaced with the browsing mode in operations 5301 to 5303. For details,refer to the descriptions in the embodiment corresponding to 42A andFIG. 42B. Details are not described herein again.

5304: The electronic device triggers, in response to the browsing mode,display of the first application interface on the first display.

In this embodiment of this application, if the electronic devicedetermines that the mode type corresponding to the first applicationinterface is not the handwriting input mode but the browsing mode, theelectronic device triggers, in response to the browsing mode, display ofonly the first application interface on the first display.

5305: The electronic device obtains the mode type corresponding to thefirst application interface.

5306: The electronic device determines whether the mode typecorresponding to the first application interface is changed tohandwriting input. If the mode type corresponding to the firstapplication interface is changed to handwriting input, operation 5307 isperformed; or if the mode type corresponding to the first applicationinterface is not changed to handwriting input, operation 5305 isperformed again.

5307: The electronic device triggers, in response to the handwritinginput mode, display of the first application interface on the seconddisplay.

In this embodiment of this application, for specific embodiments ofoperations 5305 to 5307, refer to descriptions of operations 205 to 207in the embodiment corresponding to 42A and FIG. 42B. A difference liesin that the keyboard input mode in operations 205 to 207 is replacedwith the browsing mode in operations 5305 to 5307. In addition, in thebrowsing mode, the virtual keyboard does not need to be displayed on thesecond display. Correspondingly, when the mode type corresponding to thefirst application interface changes from the browsing mode to thehandwriting input mode, the virtual keyboard displayed on the seconddisplay does not need to be disabled either. For details, refer todescriptions in the embodiment corresponding to 42A and FIG. 42B.Details are not described herein.

For more intuitive understanding of this solution, FIG. 54 to FIG. 57show four schematic diagrams of the display interface of the firstapplication interface in the application interface processing methodaccording to an embodiment of this application. First refer to FIG. 54 .FIG. 54 includes two schematic subdiagrams (a) and (b). In the schematicsubdiagram (a) in FIG. 54 , a bulb pattern and three circles aredisplayed at a bottom of the first display in FIG. 54 . The bulb patternrepresents a display interface of a desktop, and the three circlesseparately represent three different application interfaces. A currentdisplay interface of the first display is an application interface 1(namely, an example of the first application interface). Two icons in anupper right corner of the first display separately represent thebrowsing mode and the handwriting mode. The second display displays anapplication interface 2. If the electronic device obtains that the modetype corresponding to the first application interface changes from thebrowsing mode to the handwriting input mode, the schematic subdiagram(a) in FIG. 54 is triggered to be switched into the schematic subdiagram(b) in FIG. 54 . That is, the first application interface is moved tothe second display. In the schematic subdiagram (b) in FIG. 54 , theelectronic device displays the application interface 1 and theapplication interface 2 in a matrix manner, and no longer displays theapplication interface 1 on the first display. In this case, the currentdisplay interface of the first display changes to an applicationinterface 3. The user may tap the application interface 1 to triggerdisplay of the application interface 1 in a full screen mode.

Still refer to FIG. 55 . FIG. 55 includes two schematic subdiagrams (a)and (b). The schematic subdiagram (a) in FIG. 55 is consistent with theschematic subdiagram (a) in FIG. 54 , and details are not describedherein again. If the electronic device obtains that the mode typecorresponding to the first application interface changes from thebrowsing mode to the handwriting input mode, the schematic subdiagram(b) in FIG. 55 is triggered to be displayed. In the schematic subdiagram(b) in FIG. 55 , the electronic device displays the applicationinterface 1 (namely, an example of the first application interface) in aform of a floating window. In addition, the application interface 1 isno longer displayed on the first display, and the current displayinterface of the first display changes to the application interface 3.

Still refer to FIG. 56 . FIG. 56 includes two schematic subdiagrams (a)and (b). The schematic subdiagram (a) in FIG. 56 is consistent with theschematic subdiagram (a) in FIG. 54 , and details are not describedherein again. If the electronic device obtains that the mode typecorresponding to the first application interface changes from thebrowsing mode to the handwriting input mode, the schematic subdiagram(b) in FIG. 56 is triggered to be displayed. In the schematic subdiagram(b) in FIG. 56 , the electronic device displays the applicationinterface 1 (namely, an example of the first application interface) in aform of a floating window. In addition, the application interface 1 isstill displayed on the first display.

Still refer to FIG. 57 . FIG. 57 includes two schematic subdiagrams (a)and (b). The schematic subdiagram (a) in FIG. 57 is consistent with theschematic subdiagram (a) in FIG. 54 , and details are not describedherein again. If the electronic device obtains that the mode typecorresponding to the first application interface changes from thebrowsing mode to the handwriting input mode, the schematic subdiagram(b) in FIG. 57 is triggered to be displayed. In the schematic subdiagram(b) in FIG. 57 , the electronic device displays the applicationinterface 1 (namely, an example of the first application interface) in afull screen mode. In addition, the electronic device moves theapplication interface 2 displayed on the second display to the firstdisplay.

It should be noted that, in addition to the first application interface,another application interface may be displayed on the first display ofthe electronic device, and more application interfaces may also bedisplayed on the second display of the electronic device. Examples inFIG. 54 to FIG. 57 are only for ease of understanding of this solution,and are not intended to limit this solution.

5308: The electronic device obtains the mode type corresponding to thefirst application interface.

5309: The electronic device determines whether the mode typecorresponding to the first application interface is changed to thebrowsing mode. If the mode type corresponding to the first applicationinterface is changed to the browsing mode, operation 1530 is performed;or if the mode type corresponding to the first application interface isnot changed to the browsing mode, operation 5308 is performed again.

5310: The electronic device triggers, in response to the browsing mode,display of the first application interface on the first display, anddoes not display the first application interface on the second display.

In this embodiment of this application, for specific embodiments ofoperations 5308 to 5310, refer to descriptions of operations 4208 to4210 in the embodiment corresponding to FIG. 42A and FIG. 42B. Adifference lies in that the keyboard input mode in operations 4208 to4210 is replaced with the browsing mode in operations 5308 to 5310. Inaddition, when the mode type corresponding to the first applicationinterface changes from the handwriting input mode to the browsing mode,the virtual keyboard does not need to be displayed on the seconddisplay. For details, refer to descriptions in the embodimentcorresponding to FIG. 42A and FIG. 42B. Details are not describedherein.

In this embodiment of this application, when the mode type of theapplication interface is changed to the browsing mode, a layout of theapplication interface on different displays can also be automaticallyadjusted. Therefore, when the mode type of the application interface ischanged to the browsing mode, the user does not need to manually adjustthe layout of the application interface on different displays, in otherwords, in a plurality of different application scenarios, operationoperations can be simplified, and user viscosity of this solution isfurther increased.

It should be noted that, after performing operation 5310, the electronicdevice may perform operation 5305 again to detect in real time whetherthe mode type corresponding to the first application interface ischanged to handwriting input. In addition, operations 5305 to 5310 areall optional operations. If the user closes the first applicationinterface in any one of operations 5305 to 5310, other operations do notneed to be performed.

5311: The electronic device triggers, in response to the handwritinginput mode, display of the first application interface on the seconddisplay.

5312: The electronic device obtains the mode type corresponding to thefirst application interface.

5313: The electronic device determines whether the mode typecorresponding to the first application interface is changed to thebrowsing mode. If the mode type corresponding to the first applicationinterface is changed to the browsing mode, operation 5314 is performed;or if the mode type corresponding to the first application interface isnot changed to the browsing mode, operation 5312 is performed again.

5314: The electronic device triggers, in response to the browsing mode,display of the first application interface on the first display, anddoes not display the first application interface on the second display.

5315: The electronic device obtains the mode type corresponding to thefirst application interface.

5316: The electronic device determines whether the mode typecorresponding to the first application interface is changed tohandwriting input. If the mode type corresponding to the firstapplication interface is changed to handwriting input, operation 5317 isperformed; or if the mode type corresponding to the first applicationinterface is not changed to handwriting input, operation 5315 isperformed again.

5317: The electronic device triggers, in response to the handwritinginput mode, display of the first application interface on the seconddisplay.

In this embodiment of this application, for specific embodiments ofoperations 5311 to 5317, refer to descriptions of operations 4211 to4217 in the embodiment corresponding to FIG. 42A and FIG. 42B. Adifference lies in that the keyboard input mode in operations 4211 to4217 is replaced with the browsing mode in operations 5311 to 5317. Inaddition, when the mode type corresponding to the first applicationinterface changes from the handwriting input mode to the browsing mode,the virtual keyboard does not need to be displayed on the seconddisplay. When the mode type corresponding to the first applicationinterface changes from the browsing mode to the handwriting input mode,the virtual keyboard displayed on the second display does not need to bedisabled either. For details, refer to descriptions in the embodimentcorresponding to FIG. 42A and FIG. 42B. Details are not describedherein.

It should be noted that, after performing operation 5317, the electronicdevice may perform operation 5312 again to detect in real time whetherthe mode type corresponding to the first application interface ischanged to the browsing mode. In addition, operations 5312 to 5317 areall optional operations. If the user closes the first applicationinterface in any one of operations 5312 to 5317, other operations do notneed to be performed.

In this embodiment of this application, in a process of using theapplication interface by the user, the mode type corresponding to theapplication interface can be automatically detected, to adjust a displaylocation of the application interface based on the mode typecorresponding to the application interface. In addition, when theapplication interface is opened, the mode type corresponding to theapplication interface may be determined based on the start operation, todetermine the display location of the application interface, so that theuser can directly use the application interface after performing thestart operation, without performing a location movement operation on theapplication interface. This further improves convenience of thissolution, and enhances user viscosity of this solution.

The electronic device displays the first application interface on thefirst display, and detects the mode type corresponding to the firstapplication interface. If the electronic device detects that the modetype corresponding to the first application interface is handwritinginput, the electronic device triggers display of the first applicationinterface on the second display, to directly perform input by using thefirst application interface displayed on the second display. Accordingto the foregoing manner, if a user places the second display in adirection convenient for writing, the user does not need to perform anyoperation, and the electronic device can automatically display, on thesecond display convenient for writing, an application interface forwriting input. This improves efficiency of an entire input process,avoids redundant operations, simplifies the operation, and helps enhanceuser viscosity.

According to the embodiments corresponding to FIG. 41 to FIG. 57 , tobetter implement the foregoing solutions in embodiments of thisapplication, the following further provides a related device used toimplement the foregoing solutions. FIG. 58 is a schematic diagram of astructure of an electronic device according to an embodiment of thisapplication. The electronic device 1 includes a first display 501, asecond display 502, a memory 40, one or more processors 10, and one ormore programs 401. The one or more programs 401 are stored in the memory40. When the one or more processors 10 execute the one or more programs401, the electronic device is enabled to perform the followingoperations: displaying a first application interface by using the firstdisplay 501; changing a mode type corresponding to the first applicationinterface to handwriting input in response to a detected firstoperation; and triggering, in response to the handwriting input mode,display of the first application interface on the second display 502, toobtain handwriting content for the first application interface by usingthe second display 502.

In a possible design, when the one or more processors 10 execute the oneor more programs 401, the electronic device is further enabled toperform the following operations: if the electronic device detects thatthe mode type corresponding to the first application interface ischanged to keyboard input, triggering, in response to the keyboard inputmode, display of the first application interface on the first display501, and display of a virtual keyboard on the second display 502; or ifthe electronic device detects that the mode type corresponding to thefirst application interface is changed to the keyboard input mode,triggering, in response to the keyboard input mode, display of the firstapplication interface on the first display 501, and display of thevirtual keyboard and an application control bar on the second display502.

In a possible design, when the one or more processors 10 execute the oneor more programs 401, the electronic device is further enabled toperform the following operation: if the electronic device detects thatthe mode type corresponding to the first application interface ischanged to a browsing mode, triggering, in response to the browsingmode, display of the first application interface on the first display501.

In a possible design, when the one or more processors 10 execute the oneor more programs 401, the electronic device is enabled to specificallyperform any one or a combination of the following four items: if theelectronic device detects that a holding posture of an electronic penmeets a first preset condition, determining that the first operation isdetected, where the holding posture includes any one or a combination ofthe following: a holding location, holding force, and a holding angle;or obtaining a trigger instruction for handwriting input by using afirst icon, where the first icon is displayed on the first applicationinterface; or detecting a first contact operation, where the firstcontact operation is a preset tap operation or a preset track operation;or if the electronic device detects that an electronic pen is located ina preset range of the second display 502, determining that the firstoperation is detected; or if the electronic device detects that anelectronic pen changes from a first preset state to a second presetstate, determining that the first operation is detected.

In a possible design, the first operation is a slide operation in afirst direction obtained by using the second display 502. The slideoperation in the first direction is a slide operation of sliding from anupper side of the second display 502 to a lower side of the seconddisplay 502. A distance between the upper side of the second display 502and the first display 501 is shorter than a distance between the lowerside of the second display 502 and the first display 501.

In a possible design, when the one or more processors 10 execute the oneor more programs 401, the electronic device is further enabled toperform the following operations: obtaining a start operation for thesecond application interface, and determining, based on the startoperation, a mode type corresponding to the second applicationinterface, where the second application interface and the firstapplication interface are different application interfaces; if the modetype corresponding to the second application interface is handwritinginput, triggering, in response to the handwriting input mode, display ofthe second application interface on the second display 502; or if themode type corresponding to the second application interface is keyboardinput, triggering, in response to the keyboard input mode, display ofthe second application interface on the first display 501, and displayof the virtual keyboard on the second display 502; or if the mode typecorresponding to the second application interface is a browsing mode,triggering, in response to the browsing mode, display of the secondapplication interface on the first display 501.

It should be noted that content such as information exchange and anexecution process between the modules/units in the electronic device 1is based on a same concept as the method embodiments corresponding toFIG. 41 to FIG. 57 in this application. For specific content, refer tothe descriptions in the foregoing method embodiments in thisapplication. Details are not described herein again.

An embodiment of this application further provides an electronic device.FIG. 59 is a schematic diagram of a structure of an electronic deviceaccording to an embodiment of this application. An electronic device 1may be specifically represented as a mobile phone, a tablet computer, anotebook computer, another device provided with a display, or the like.This is not limited herein. The electronic device described in theembodiment corresponding to FIG. 58 may be deployed on the electronicdevice 1 and is configured to implement a function of the electronicdevice in the embodiments corresponding to FIG. 41 to FIG. 57 .Specifically, the electronic device 1 may vary greatly with aconfiguration or performance, and may include one or more centralprocessing units (CPU) 1522 (for example, one or more processors), amemory 40, and one or more storage media 1530 (for example, one or moremass storage devices) that store an application 1542 or data 1544. Thememory 40 and the storage medium 1530 may be for temporary storage orpermanent storage. The program stored in the storage medium 1530 mayinclude one or more modules (which are not shown in the figure), andeach module may include a series of instruction operations on theelectronic device. Further, the central processing unit 1522 may beconfigured to communicate with the storage medium 1530, and perform, onthe electronic device 1, the series of instruction operations in thestorage medium 1530.

The electronic device 1 may further include one or more power supplies1526, one or more wired or wireless network interfaces 1550, one or moreinput/output interfaces 1558, and/or one or more operating systems 1541,for example, Windows Server™, Mac OS X™, Unix™, Linux™, and FreeBSD™.

In this embodiment of this application, the central processing unit 1522is configured to implement a function of the electronic device in theembodiments corresponding to FIG. 41 to FIG. 57 . It should be notedthat, for a specific embodiment in which the central processing unit1522 performs the function of the electronic device in the embodimentscorresponding to FIG. 41 to FIG. 57 and a beneficial effect of thefunction, refer to the descriptions in the method embodimentcorresponding to FIG. 41 to FIG. 57 . Details are not described hereinagain.

An embodiment of this application further provides a computer-readablestorage medium. The computer-readable storage medium stores a computerprogram. When the program is run on a computer, the computer is enabledto perform the operations performed by the electronic device in themethod described in the embodiments shown in FIG. 42A and FIG. 42B toFIG. 57 .

An embodiment of this application further provides a computer program.When the computer program is run on a computer, the computer is enabledto perform the operations performed by the electronic device in themethod described in the embodiments shown in FIG. 42A and FIG. 42B toFIG. 57 .

An embodiment of this application further provides a circuit system. Thecircuit system includes a processing circuit, and the processing circuitis configured to perform the operations performed by the electronicdevice in the method described in the embodiments shown in FIG. 42A andFIG. 42B to FIG. 57 .

The electronic device provided in this embodiment of this applicationmay be specifically a chip. The chip includes a processing unit and acommunication unit. The processing unit may be, for example, aprocessor. The communication unit may be, for example, an input/outputinterface, a pin, or a circuit. The processing unit may execute computerexecutable instructions stored in a storage unit, so that the chipperforms the operations performed by the electronic device in the methoddescribed in the embodiments shown in FIG. 42A and FIG. 42B to FIG. 57 .Optionally, the storage unit is a storage unit in the chip, for example,a register or a cache; or the storage unit may be a storage unit that isin a radio access device and that is located outside the chip, forexample, a read-only memory (read-only memory, ROM), another type ofstatic storage device that can store static information andinstructions, or a random access memory (RAM).

The processor mentioned anywhere above may be a general-purpose centralprocessing unit, a microprocessor, an ASIC, or one or more integratedcircuits that are configured to control program execution of the methodaccording to the first aspect.

In addition, it should be noted that the described apparatus embodimentsare only examples. The units described as separate parts may or may notbe physically separate, and parts displayed as units may or may not bephysical units, may be located in one location, or may be distributed ona plurality of network units. Some or all of the modules may be selectedbased on actual requirements to achieve the objectives of the solutionsin embodiments. In addition, in the accompanying drawings of theapparatus embodiments provided by this application, connectionrelationships between modules indicate that the modules havecommunication connections with each other, which may be specificallyimplemented as one or more communication buses or signal cables.

Based on the description of the foregoing embodiments, a person skilledin the art may clearly understand that this application may beimplemented by software in addition to necessary universal hardware, orcertainly may be implemented by dedicated hardware, including adedicated integrated circuit, a dedicated CLU, a dedicated memory, adedicated component, and the like. Usually, any function implemented bya computer program may be easily implemented by using correspondinghardware. In addition, specific hardware structures used to implement asame function may be various, for example, an analog circuit, a digitalcircuit, or a dedicated circuit. However, in this application, asoftware program embodiment is a better embodiment in most cases. Basedon such an understanding, the technical solutions of this applicationessentially or the part contributing to the conventional technology maybe implemented in a form of a software product. The computer softwareproduct is stored in a readable storage medium, such as a floppy disk, aUSB flash drive, a removable hard disk, a ROM, a RAM, a magnetic disk,or an optical disc of a computer, and includes several instructions forinstructing a computer device (which may be a personal computer, aserver, or a network device) to perform the methods described inembodiments of this application.

All or some of the foregoing embodiments may be implemented by software,hardware, firmware, or any combination thereof. When software is used toimplement the foregoing embodiments, all or some of the embodiments maybe implemented in a form of a computer program.

The computer program includes one or more computer instructions. Whenthe computer program instructions are loaded and executed on a computer,the procedures or functions according to embodiments of this applicationare all or partially generated. The computer may be a general-purposecomputer, a dedicated computer, a computer network, or anotherprogrammable apparatus. The computer instructions may be stored in acomputer-readable storage medium or may be transmitted from acomputer-readable storage medium to another computer-readable storagemedium. For example, the computer instructions may be transmitted from awebsite, computer, server, or data center to another website, computer,server, or data center in a wired (for example, a coaxial cable, anoptical fiber, or a digital subscriber line (DSL)) or wireless (forexample, infrared, radio, or microwave) manner. The computer-readablestorage medium may be any usable medium accessible to a computer, or adata storage device integrating one or more usable media, for example, aserver or a data center. The usable medium may be a magnetic medium (forexample, a floppy disk, a hard disk, or a magnetic tape), an opticalmedium (for example, a DVD), a semiconductor medium (for example, asolid state drive (SSD)), or the like.

Embodiment 4

This embodiment of the present invention may be applied to various smartmulti-screen display terminals. For example, this embodiment of thepresent invention may be applied to a dual-screen electronic device. Asshown in FIG. 60 , the electronic device may be an electronic devicehaving two displays. The two displays may be two separate displays, ormay be two displays divided from a flexible folding screen or a curvedscreen. The electronic device may be an electronic device that worksindependently as a whole, for example, a personal notebook computer, ormay be an electronic device formed by connecting two electronic devicesthat can work independently and work together, for example, adual-screen electronic device formed by splicing two mobile phones ortwo tablet computers.

The dual-screen electronic device or the dual-screen electronic deviceformed by splicing two tablet computers usually includes a first displayand a second display. The first display is mainly configured to providean output function, that is, present currently running content, anexecuted operation, or the like to a user. Certainly, the first displaymay further have an input function. For example, the first displayregion may have a touchscreen function, performing an operation on acurrent application by using a touchscreen gesture. Compared with thefirst display, the second display is usually closer to a hand of theuser, facilitating a user operation. Therefore, the second displaymainly performs an input function, and may receive user input by using atouch display. On the touch display, the user input may also be receivedby using a virtual keyboard instead of a conventional mechanicalkeyboard. Certainly, the second display may also have an outputfunction. For example, the second display may also be configured topresent the currently running content, the executed operation, or thelike to the user.

This embodiment of the present invention may be further used in asingle-application dual-screen cross-device operation, where a displayof a controlled device is mainly configured to present currently runningcontent or an executed operation to the user, in other words, is mainlyconfigured to implement the function of the first display. A functionmenu corresponding to a target application on the first display is movedto a display of a control device, in other words, is mainly configuredto implement the function of the second display, to control anapplication on the controlled device. For example, as shown in FIG. 61 ,a tablet computer (61-1) or a mobile phone (61-2) may be used as acontrol terminal to remotely operate an application of a computer(61-3); the tablet computer (61-1) or the mobile phone (61-2) may beused as the control terminal to remotely operate an application of asmart screen (61-4); or the mobile phone and the tablet computer areinterconnected, so that one is used as the control terminal to operatean application of the other one. Specifically, this embodiment of thepresent invention may be applied to a smart home scenario. For example,the controlled device may be a smart home device having a display, suchas a television, a microwave oven, a refrigerator, or a washing machine,and the control device may be a mobile phone, a tablet computer, or acomputer. This embodiment of the present invention may be furtherapplied to the field of smart cockpits. For example, a mobile phone or atablet computer is used as the control device to control a front-rowvehicle head unit screen or a rear-row display, or to control thefront-row vehicle head unit screen by using the rear-row display.

In the foregoing scenario, an interface of an application usually uses afixed layout manner, and each interface is completely displayed on thefirst display. For example, a control key in the application is usuallylocated in a function region menu on a top or a left side of theapplication. When the user needs to perform an operation on the controlkey in the application, regardless of a specific location of a currentoperation object of the user, the user needs to move a cursor to thefunction region menu to perform the operation, and then return to thecurrent operation object. In one case, it may be difficult for the userto locate a specific control key in the function region menu of theapplication. In another case, after moving the cursor to the specificcontrol key, it is difficult for the user to locate the currentoperation object again. In both cases, it is difficult for the user toperform an appropriate operation. In addition, in the foregoingoperations, the user needs to control the cursor to continuously switchbetween the operation object and the function region menu. This causes acomplex user operation and low operation efficiency.

Refer to FIG. 62 . An embodiment of the present invention provides ascreen display method 6200. The screen display method 6200 is used todisplay a control region on the second display, so that a user cancontrol the target application or an operating system on the firstdisplay by using the control region on the second display.

When the method in this embodiment of the present invention is appliedto a dual-screen display electronic device, for example, a dual-screenelectronic device, a face B (a face usually set to a display) of thedual-screen electronic device may be used as the first display, and aface C (a face usually set to a keyboard) of the dual-screen electronicdevice may be used as the second display. In an embodiment, as shown inFIG. 63A, the face B may display a main display interface and a functionmenu bar of the target application operated by the user, and the face Cmay include a virtual keyboard and a control region. In anotherembodiment, as shown in FIG. 63B, the face B may display a main displayinterface and a function menu bar of the target application operated bythe user, and the face C may include another application interface and acontrol region. In another embodiment, as shown in FIG. 63C, the face Bmay display a main display interface and a function menu bar of thetarget application operated by the user, and the face C may include onlya control region. When the method in this embodiment of the presentinvention is applied to a single-application dual-screen cross-deviceoperation, a display of a controlled device may correspond to a face Bof a dual-screen electronic device, a display of a control device maycorrespond to a face C of the dual-screen electronic device. For displaycontent of the displays of the controlled device and the control device,refer to FIG. 63A to FIG. 63C.

One application may usually include one main display interface and oneor more function menu bars that include a control key corresponding tothe application. The main display interface is usually used to display acurrent state of the application or an execution result of a useroperation to the user. The control key in the function menu bar isusually used to receive user input and perform a specific operation onthe target application. A text editing application is used as anexample. A main display interface of the text editing application is aninterface for displaying a currently edited document, and is usually aninterface with a largest display area in the entire application. Inaddition, a function menu bar of the text editing application mayinclude a function menu bar such as an editing menu bar (includingcontrol keys such as file, start, insert, design, and page layout) and anavigation menu bar, and is configured to receive an operationinstruction of a user on the document. Usually, both the main displayinterface and the function menu bar of the application are displayed onthe first display, and the user may operate the application on the firstdisplay only by using a mouse or a touchscreen gesture.

In this embodiment of the present invention, the control region isprovided in the second display, and the control region may include aplurality of display regions. For example, in an embodiment, the controlregion may include a system control bar and an application control bar.The system control bar may include one or more functional modules. Eachfunctional module includes a control key group related to an operatingsystem. The application control bar may include one or more functionalmodules. Some functional modules may include a control key groupcorresponding to the target application. Some functional modules mayinclude a shortcut operation control key group related to a current useroperation. It should be understood that another display region settingand a functional module setting that help improve user operationefficiency are also possible. The control region is provided in thesecond display, so that the user can operate the target application orthe system on the first display by using the control key on the seconddisplay. This provides a more convenient operation manner for the userand improves user operation efficiency.

Preferably, a location of the control region on the second display maybe flexibly adjusted based on a user requirement. For example, thecontrol region may be located at an upper end of the second display, andis located on an upper side of other display content (anotherapplication, the virtual keyboard, and the like) on the second display.Alternatively, the control region may be located at a lower end of thesecond display, and is located on a lower side of other display content(another application, the virtual keyboard, and the like) on the seconddisplay. Alternatively, the control region may be located on a left sideor a right side of the second display. An initial display location ofthe control region may be customized by the system or the user. When thecontrol region is displayed on the second display, the user may alsoflexibly move a location of the control region on the second display.

The screen display method 6200 may include the following operations.

Operation 6201: Activate the Control Region.

In an embodiment, in a general use state, the control region may bedisabled. In this case, a main display module and some function menubars of the target application may be displayed on the first display,and a control key in the function menu bar on the first display isoperated in a general operation manner through a mouse operation or atouchscreen gesture, to implement an operation on the targetapplication.

When the user needs to enable the control region on the second displayto more quickly use the control key in the target application on thefirst display, to improve operation efficiency, the user may activatethe control region in a plurality of manners. In an embodiment, thecontrol region may be related to the virtual keyboard, and the controlregion is enabled by default when the virtual keyboard is enabled. Inthis case, the virtual keyboard and the control region may besimultaneously activated by using an instruction for activating thevirtual keyboard, as shown in FIG. 64A. In another embodiment, as shownin FIG. 64B, a control switch of the control region may be provided onthe virtual keyboard. When the virtual keyboard is enabled but thecontrol region is not enabled, the control region may be activated byusing the control switch on the virtual keyboard. In another embodiment,as shown in FIG. 64C, the control region may be activated throughgesture control, that is, a gesture for activating an auxiliary displayregion is stored in a storage module, and when the gesture performed bythe user is detected, the control region is activated. The controlgesture may be, for example, a finger slides inward from a side of thedisplay. In another embodiment, whether the control region is enabledmay be related to a display mode of the application. When a full-screenmode of the application is enabled, some display modules of theapplication are usually hidden. Therefore, the control region may beactivated when the full-screen mode of the application is enabled, tofurther display content of the display modules, as shown in FIG. 64D. Itshould be understood that the foregoing operation manner of activatingthe control region is only an example, and another operation manner ofactivating the control region is also possible.

The control region is disabled in a general use state, and is activatedby performing a simple operation when needed. This can simplify a useroperation interface when the control region is not needed, and avoidinterference of the control region with a general use state.

In another embodiment, the control region may be enabled by defaultafter the electronic device is started. In this way, the user does notneed to activate the control region by performing operation 6201.Therefore, operation 6201 is an optional operation of the screen displaymethod 6200.

Operation 6202: Obtain an Operation Performed by the User on the TargetApplication.

In this embodiment of the present invention, display content in thecontrol region is determined based on the operation performed by theuser on the target application. In an embodiment, the operationperformed by the user on the target application is displaying anoperation interface of the target application on the first display. Forexample, before the user performs the operation, the target applicationmay be disabled, and the user displays the operation interface of thetarget application on the first display by starting the targetapplication. Alternatively, before the user performs the operation, thetarget application may be in a background running state, and the userdisplays the operation interface of the target application on the firstdisplay through a switching operation. When the operation performed bythe user on the target application is displaying the operation interfaceof the target application on the first display, the control keycorresponding to the target application may be displayed in theapplication control bar. After the operation interface of the targetapplication is displayed on the first display, the first display maydisplay only the operation interface of the target application, or mayjointly display operation interfaces of a plurality of applicationsincluding the target application, for example, display in a dual-screenor multi-screen operation mode.

Optionally, in an embodiment, the application developer may provide thepriority sequence of the functional modules and the priority sequence ofthe control keys of the application, and then the system may determine,based on an actual situation (the display area of the control region,and the like), the specific functional module and control key to bedisplayed in the application control bar corresponding to theapplication in the control region, and determine the layout manner ofthe application control bar.

In this embodiment, information that is about the target application andthat is obtained by the system from the application may include eachfunctional module of the target application, the control key included ineach functional module, the priority sequence of the functional modules,and the priority sequence of different control keys in each functionalmodule. The following separately describes the various information aboutthe target application.

(1) Functional Module and Control Key

One application usually includes one main display module and a pluralityof function menu bars, to control content in the main display module.The functional module in the control region may correspond to thefunction menu bar of the target application. A slide editing applicationis used as an example. T slide editing application may include a maindisplay interface, a functional module 1, a functional module 2, afunctional module 3, and the like. The main display interface displays aslide interface that is currently being edited by the user. Thefunctional module 1 includes a common control key set for editing theslide interface. The functional module 2 is used to display all slidesfor the user to browse. The functional module 3 includes a control keyset for a shortcut operation. It should be understood that, differentapplications implement different functions, and therefore a functionalmodule setting and a control key setting in functional modules of thedifferent applications may be different.

(2) Priority of the Functional Module

The priority of the functional module indicates an importance degree ofeach functional module in a use process of the user, and may be usuallydetermined based on an indicator such as an importance degree of afunction of each functional module, and a use frequency of the user. Forexample, priorities of the functional modules of the slide editingapplication may be defined as follows: a priority of a functional module1>a priority of a functional module 2>a priority of a functional module3. It should be understood that the foregoing definition of thepriorities of the functional modules of the slide editing application isonly an example. Another possible definition manner that meets a usehabit of the user is also possible.

Optionally, in an embodiment, one or more mandatory functional modulesmay be defined for the application. The mandatory functional module is afunctional module that is fixedly displayed in an enabled control regionand that corresponds to the application. In addition, one or morepreferred functional modules may further be defined for the targetapplication. The preferred functional module is a functional module thatcan be preferentially displayed after all mandatory functional modulesof the application are displayed in the control region. A prioritysequence of each functional module of the target application may be setas follows: A mandatory functional module has a highest priority, apreferred functional module has a second highest priority, and anotherfunctional module has a third highest priority.

(3) Priority of the Control Key in the Functional Module

The priority of the control key indicates an importance degree of eachcontrol key in the use process of the user, and may be usuallydetermined based on an indicator such as an importance degree of acontrol function of each control key and a use frequency of the user. Acontrol key for editing text is used as an example. In an embodiment,priorities of control keys such as copy, paste, cut, font, paragraph,definition, synonym, and translation may be defined as follows: Copy andpaste have highest priorities, cut has a lower priority than prioritiesof copy and paste, font and paragraph have lower priorities than thepriority of cut, and definition, synonym, and translation have lowerpriorities than the priorities of font and paragraph. It should beunderstood that the foregoing priority definition is only a possibleembodiment. Another manner of defining a priority of the function key inthe application that conforms to the use habit of the user or that iscommonly used is also possible.

In an embodiment, one or more mandatory control keys may be defined foreach functional module. The mandatory control key is a control key thatis regularly displayed when a corresponding functional module isdisplayed in the control region. In addition, one or more preferredcontrol keys may be defined for each functional module. The preferredcontrol key is a control key that may be preferentially displayed afterall control keys in a corresponding functional module are displayed inthe control region. A priority sequence of different control keys in asame functional module may be set as follows: A mandatory control keyhas a highest priority, a preferred control key has a second highestpriority, and another control key has a third highest priority.

Optionally, in another embodiment, the application developer maydirectly define display content of the application control bar ofdifferent display areas, including the functional module and the controlkey in the application control bar, and the layout manner of theapplication control bar. For example, the application developer sets adisplay manner 1 of the application control bar for a display area 1, adisplay manner 2 of the application control bar for a display area 2,and a display manner 3 of the application control bar for a display area3. The display area 1, the display area 2, and the display area 3 maynot specifically mean a specific size, and may be a range. In this case,the system may select a corresponding display manner of the applicationcontrol bar based on the display area of the application control bar.

In this embodiment, information about the target application obtained bythe system from the application may include display manners of theapplication control bar of different display areas, and specificallyinclude a specific functional module included in each display manner ofthe application control bar, a specific control key included in eachfunctional module, and the layout manner of the application control bar.The display manner of the application control bar displayed in thecontrol region may be completely the same as the display manner providedby the application.

Optionally, in another embodiment, the system may identify eachfunctional module of the application and a control key in the functionalmodule by using a text or image recognition technology. The system setsa priority sequence for each functional module and the control key ofthe application based on a use frequency or an importance degree of auser. Then, the system determines, based on the set priority sequence, aspecific functional module and control key to be displayed in theapplication control bar, and determines a specific layout manner. Inthis embodiment, the system may not obtain additional information fromthe application.

It should be understood that, in the foregoing three embodiments, aninteraction manner between the application and the system is only anexample. Another feasible interaction manner or a new embodimentemerging with technology development is also possible.

In another embodiment, the operation performed by the user on the targetapplication is an operation on the operation interface of the targetapplication, for example, selecting specific content on the operationinterface of the target application, or placing a cursor at a specificlocation on the operation interface of the target application. When theoperation performed by the user on the target application is theoperation on the operation interface of the target application, ashortcut control key related to the operation may be displayed in theapplication control bar.

The operation performed by the user on the operation interface of thetarget application includes any possible operation performed by the userwhen the user performs a specific function through the targetapplication. In an embodiment, the operation performed by the user onthe target application may be selecting a specific object on theoperation interface, for example, selecting specific text, a symbol, apicture, a table, audio, or a video. The user may select the specificobject in a plurality of manners such as a touchscreen gesture or amouse operation. For example, the user may move the cursor to thespecific object through the touchscreen gesture or the mouse operation,and may select the specific object (shading of the specific object isdeepened) through the touchscreen gesture or the mouse operation. Inanother embodiment, the operation performed by the user on the operationinterface of the target application may be a unique gesture or a mouseoperation in a unique manner, for example, performing a slide gesture orscrolling a scroll wheel of the mouse to scroll content in the targetregion, to browse the content in the target region. It should beunderstood that the foregoing operations are only examples, and anotheroperation that may be performed by the user on the target application ina process of using the electronic device is possible.

Different operations performed by the user on the operation interface ofthe target application may correspond to different control key groups.Control keys in the control key group may be a shortcut operation keyset related to a specific operation. As shown in FIG. 65A, in anembodiment, the specific operation performed by the user on the targetapplication may be selecting specific text content, for example, placingthe cursor on the text content. A control key group corresponding to thespecific operation may include a control key set such as copy, paste,cut, font, font size, paragraph, definition, synonym, translation, andsearch via internet. As shown in FIG. 65B, in an embodiment, thespecific operation performed by the user on the target application maybe selecting specific picture content. A control key group correspondingto the specific operation may include a control key set such as copy,paste, cut, set a picture format, change a picture, place on top, placeon bottom, and save a picture. As shown in FIG. 65C, in an embodiment,the specific operation performed by the user on the target applicationmay be selecting specific table content. A control key groupcorresponding to the specific operation may include a control key setsuch as copy, paste, cut, format, insert a row, insert a column, anddelete a table. As shown in FIG. 65D, in an embodiment, the specificoperation performed by the user on the target application may beselecting specific video content. A control key group corresponding tothe specific operation may include a control key set such as play,pause, volume up, volume down, brighter, dimmer, picture-in-picture,copy a video address, cast, loop, and a progress bar. As shown in FIG.65E, in an embodiment, the specific operation performed by the user onthe target application may be selecting specific audio content. Acontrol key group corresponding to the specific operation may include acontrol key set such as play, pause, next, volume up, volume down, copyan audio address, loop, and a progress bar. As shown in FIG. 65F, in anembodiment, the specific operation performed by the user on the targetapplication may be browsing content in the target region through theslide gesture or scrolling the scroll wheel of the mouse. A control keygroup corresponding to the specific operation may include a thumbnail ofthe target region, a locating box for quickly locating target content inthe thumbnail, and the like.

Optionally, in an embodiment, the system may define different controlkey sets for different user operations. The different shortcut operationcontrol key groups are displayed for the different user operations onthe target application. This can meet a user requirement, provide a moreconvenient operation or the user, and improve user operation efficiency.In another embodiment, the control key set may also be defined as acontrol key set displayed by right-clicking a current mouse location. Asimple design in which the control key set is defined as the control keyset displayed by right-clicking can avoid secondary development of thedeveloper, reduce a burden of the developer, and shorten a developmentcycle.

Operation 6203: Obtain the Display Area of the Control Region.

Operation 6203 is an optional operation. When the display area of thecontrol region is fixed, the display area of the control region does notneed to be obtained, and operation 6204 may be directly performed. Whenthe display area of the control region can be flexibly adjusted,operation 6203 may be performed.

Optionally, in an embodiment, the display area of the control region maybe flexibly adjusted. Optionally, each time the control region isenabled, an initial display area of the control region may be different.For example, different applications may correspond to different initialdisplay areas. In an embodiment, the initial display area of the controlregion may be defined by the system. The system may define initialdisplay areas of different control regions for different applications.In another embodiment, the initial display area of the control regionmay be customized by the user, and the user may define initial displayareas of different control regions for different applications. Inanother embodiment, the initial display area of the control region maybe, by default, a display area of a control region enabled when theapplication is used last time. It should be understood that anotherpossible manner of defining the initial display area of the controlregion that is commonly used in the art is also possible.

The display area of the control region is flexibly set, so that thefunctional module and the control key group displayed in the controlregion can better conform to a user habit, provide a more convenientoperation for the user, and improve user operation efficiency.

A location and a layout manner of the control region may be flexiblyprovided based on a requirement. Optionally, as shown in FIG. 63A, in anembodiment, the control region may be disposed above the virtualkeyboard or another application interface on the second display. Asshown in FIG. 63B, in another embodiment, the control region may bedisplayed on a left side or a right side of the second display. As shownin FIG. 63C, in another embodiment, the control region may be displayedin the middle of the second display. As shown in FIG. 66A, in anotherembodiment, when the virtual keyboard or another application is notenabled on the second display, the target application on the firstdisplay may occupy a part of a display area of the second display.Correspondingly, the control region may be located at a bottom of thesecond display. As shown in FIG. 66B, in another embodiment, twodisplays of the dual-screen electronic device may be placed left andright. In this case, the virtual keyboard may be designed in a separatemanner, and is located at lower ends of the two displays.Correspondingly, the application display region may be disposed in themiddle of the separated keyboard.

Operation 6204: Display the Control Key Group in the Control Region.

In operation 6204, comprehensively considering the information obtainedin the foregoing one or more operations, the functional module and thecontrol key group included in the control region are determined, and aredisplayed in the control region.

Optionally, as shown in FIG. 67 , in an embodiment, the control regionmay include the following regions:

(1) System Control Bar

The system control bar is mainly used to display a control key setrelated to system control, and optionally, may include a system controlfunctional module and a dock functional module. The system controlfunctional module may include a control key group used to execute anoperating system. For example, the system control functional module mayinclude a control key set such as adjust volume, adjust brightness,query weather, view time, view a calendar, view an alarm, and view asystem notification. The dock functional module may include a controlkey group used to switch between a plurality of task programs in thesystem. For example, the dock functional module may include a controlkey such as a currently running program list, a frequently used/favoriteapplication list, a recently used application list, or a desktopapplication list. Optionally, the control key set related to the systemoperation in the system control bar may be a relatively fixed controlkey set that is set by the system. Alternatively, the user may adjust,based on the use habit, the control key set in the system control barthat is set by the system.

(2) Application Control Bar

The application control bar is mainly used to display the control keygroup corresponding to the target application. The application controlbar may include one or more functional modules corresponding to thetarget application and/or a shortcut operation functional module relatedto the operation performed by the user on the target application.

In an embodiment, when the operation performed by the user on the targetapplication is displaying the operation interface of the targetapplication on the first display, the control key group corresponding tothe target application may be displayed in the control region. Asdescribed in operation 302, optionally, in an embodiment, theapplication developer may provide the priority sequence of thefunctional modules and the priority sequence of the control keys of theapplication, and then the system may determine, based on an actualsituation (the display area of the control region, and the like), thespecific functional module and control key to be displayed in theapplication control bar corresponding to the application in the controlregion, and determine the layout manner of the application control bar.

Preferably, when the display area of the control region is the smallest,the control key set of the target application may include the mandatoryfunctional module of the target application and the mandatory controlkey in the mandatory functional module.

Preferably, when the display area of the control region is greater thana minimum display area, in an embodiment, control keys in the controlkey set of the target application may be added based on an overallpriority sequence shown in FIG. 68 by comprehensively considering thepriority sequence of the functional modules and the priority sequence ofthe control keys of the target application. Specifically, a priority ofa mandatory control key in a mandatory functional module>a priority of apreferred control key in the mandatory functional module>a priority of amandatory control key in a preferred functional module>a priority of apreferred control key in the preferred functional module>a priority of amandatory control key in another functional module>a priority of apreferred control key in the another functional module>a priority ofanother control key in the mandatory functional module>a priority ofanother control key in the preferred functional module>a priority ofanother control key in the another functional module. Therefore, in aprocess of gradually increasing the initial display area of the controlregion, the mandatory control key in the mandatory functional module isfirst added to the control key set of the target application, thepreferred control key in the mandatory functional module is added to thecontrol key set of the target application, the mandatory control key inthe preferred functional module is added to the control key set of thetarget application, the preferred control key in the preferredfunctional module is added to the control key set of the targetapplication, the mandatory control key in the another functional moduleis added to the control key set of the target application, the anothercontrol key in the mandatory functional module is added to the controlkey set of the target application, the another control key in thepreferred functional module is added to the control key set of thetarget application, and then the another control key in the anotherfunctional module is added to the control key set of the targetapplication. Specifically, in a process of determining a specific typeof control key in a specific type of functional module, the control keyis added for displaying based on a priority sequence of each specificcontrol key.

Preferably, when the display area of the control region is greater thana minimum display area, in another embodiment, control keys in thecontrol key set of the target application may be added based on thepriority sequence shown in FIG. 69 by comprehensively considering thepriority sequence of the functional modules and the priority sequence ofthe control keys of the target application. Specifically, a priority ofa mandatory control key in a mandatory functional module>a priority of apreferred control key in the mandatory functional module>a priority of amandatory control key in a preferred functional module>a priority of apreferred control key in the preferred functional module>a priority of amandatory control key in another functional module>a priority of anothercontrol key in the mandatory functional module>a priority of anothercontrol key in the preferred functional module>a priority of a mandatorycontrol key in another functional module>a priority of a preferredcontrol key in the another functional module>a priority of anothercontrol key in the another functional module. Therefore, in a process ofgradually increasing the initial display area of the control region, themandatory control key in the mandatory functional module is first addedto the control key set of the target application, the preferred controlkey in the mandatory functional module is added to the control key setof the target application, the mandatory control key in the preferredfunctional module is added to the control key set of the targetapplication, the preferred control key in the preferred functionalmodule is added to the control key set of the target application, theanother control key in the mandatory functional module is added to thecontrol key set of the target application, the another control key inthe preferred functional module is added to the control key set of thetarget application, the mandatory control key in the another functionalmodule is added to the control key set of the target application, thecontrol key in the another functional module is added to the control keyset of the target application, and then the another control key in theanother functional module is added to the control key set of the targetapplication. Specifically, in a process of determining a specific typeof control key in a specific type of functional module, the control keyis added for displaying based on a priority sequence of each specificcontrol key.

It should be understood that the foregoing two priority sequences areonly examples, and another priority definition manner that meets the usehabit of the user is also possible.

As described in operation 6202, optionally, in another embodiment, theapplication developer may directly define display content of theapplication control bar of different display areas, including thefunctional module and the control key in the application control bar,and the layout manner of the application control bar. The systemselects, based on the display area of the application control bar, aspecific display manner of the application control bar corresponding tothe application. Optionally, in another embodiment, the system mayidentify each functional module of the application and a control key inthe functional module by using a text or image recognition technology.The system sets a priority sequence for each functional module and thecontrol key. Then, the system determines, based on the set prioritysequence, a specific functional module and control key to be displayedin the application control bar, and determines a specific layout manner.

Optionally, the application control bar may include a shortcut operationfunctional module related to a current operation performed by the useron the target application. The shortcut operation functional modulemainly includes a shortcut operation control key group related to thecurrent operation performed by the user on the target application, forexample, a control key set corresponding to different user operationsdescribed in operation 6203. In an embodiment, a shortcut operationcontrol key related to the user operation may be defined by theapplication developer. That is, the application developer sets acorresponding shortcut operation control key set based on differentoperations performed by the user on the target application. In thisembodiment, a same user operation may correspond to a different shortcutoperation control key set in a different application. In anotherembodiment, a control key related to the user operation may be definedby the system. That is, the system sets a shortcut operation control keyset corresponding to different operations of the user. In thisembodiment, a same user operation may correspond to a same shortcutoperation control key set in a different application.

In another embodiment, when the operation performed by the user on thetarget application is the operation on the operation interface of thetarget application, a shortcut control key group related to the useroperation may be displayed in the control region. Optionally, in anembodiment, only the control key group related to the operationperformed by the user on the operation interface of the targetapplication may be displayed in the application control bar. In otherwords, an initial control key group that is originally displayed in theapplication control bar and that corresponds to the target applicationis replaced with the control key group related to the operationperformed by the user on the operation interface of the targetapplication. In another embodiment, both the initial control key groupcorresponding to the target application and the control key grouprelated to the operation performed by the user on the operationinterface of the target application may be displayed in the applicationcontrol bar. In other words, the control key group related to theoperation performed by the user on the operation interface of the targetapplication is added based on the initial control key groupcorresponding to the target application.

When specific shortcut control keys corresponding to the user operationdisplayed in the application control bar are determined, an embodimentlogic similar to the foregoing manner of determining the control keycorresponding to the target application may be used. In an embodiment,the system may define a priority sequence of the shortcut control keyscorresponding to the user operation, and then determine, based on thedisplay area of the application control bar, specific shortcut controlkeys to be displayed in the application control bar. In anotherembodiment, the system may define corresponding shortcut control keygroups for the application control bar of different display areas, andthen determine, based on an actual display area of the applicationcontrol bar, a shortcut control key group displayed in the applicationcontrol bar.

Operation 6205: Hide Display of the Control Key Group in the ControlRegion on the First Display.

Operation 6205 is an optional operation. Preferably, after the controlregion on the second display is activated and the related control keygroup is displayed in the control region, display of the control keygroup in the control region on the first display may be hidden. This cansave display space of the first display and expand a display area of amain display interface of the target application or a display area ofanother functional module in the first display region. The hidingdisplay of the control key group in the control region on the firstdisplay may be that the control key in the control region is notdisplayed on the first display, or may be that the control key in thecontrol region is folded on the first display, or may be that thecontrol key in the control region displayed on the first display isfaded, for example, the control key turns gray.

After the control key group in the application control bar is notdisplayed on the first display, display content on the first display maybe adaptively adjusted. In an embodiment, after the control key set ofthe target application is not displayed on the first display, a size ofdisplay content of the main display interface of the target applicationor a size of display content of the another functional module may beincreased, for example, a display font is enlarged, and a displaypicture is zoomed in, and a layout on the first display is adaptivelyadjusted. This embodiment can facilitate browsing for the user, andimprove user experience.

In another embodiment, after the control key set of the targetapplication is not displayed on the first display, display content ofthe main display interface of the target application may be added, orsome functional modules that were not displayed before may be added tothe first display, or undisplayed content of the functional moduledisplayed on the first display may be added, and a layout on the firstdisplay is adaptively adjusted. For example, the application may definea plurality of layout manners that include different control keys andthat are used for displaying on the first display. The system selects,based on the control key group displayed in the application control bar,a layout manner that is of the application on the first display and thatadapts to the control key group. After the control key set of the targetapplication is not displayed on the first display, display content onthe first display is added, so that more detailed content or anoperation manner of the target application can be reflected, and a moreconvenient operation is provided for the user. Certainly, one or more ofthe foregoing three types of display content may be all added, ordisplay content may be added and display content may be zoomed in. Itshould be understood that, after the control key set of the targetapplication is not displayed on the first display, another manner ofchanging the content layout on the first display that helps improve userexperience is also possible.

Operation 6206: Disable the Control Region.

Optionally, in an embodiment, when the user temporarily does not need touse the control region, the control region may be disabled in aplurality of manners. In an embodiment, the control region may berelated to the virtual keyboard, and the control region is disabled bydefault when the virtual keyboard is disabled. In this case, the virtualkeyboard and the control region may be simultaneously disabled by usingan instruction for disabling the virtual keyboard, as shown in FIG. 70A.In another embodiment, as shown in FIG. 70B, a control switch of thecontrol region may be provided on the virtual keyboard. When the virtualkeyboard is enabled, the control region may be disabled by using thecontrol switch on the virtual keyboard. In another embodiment, as shownin FIG. 70C, the control region may be disabled through gesture control,that is, a gesture corresponding to disabling an auxiliary displayregion is stored in a storage module, and when the gesture performed bythe user is detected, the control region is disabled. The controlgesture may be, for example, a finger moves the control region to a sideof the display through a slide operation. In another embodiment, whetherthe control region is enabled may be related to a display mode of theapplication. When the full-screen mode of the application is disabled,the control region may be disabled, and some content in the controlregion is migrated back to the first display region for displaying, asshown in FIG. 70D.

When the user does not need to use the control region temporarily,display of the control region is temporarily disabled, so that a displayarea of another application on the second display can be expanded. Ifthe control region is not needed, interference of the control regionwith the another application on the second display is reduced, and auser operation interface is simplified.

In another embodiment, content in the control region may be alwaysdisplayed on the second display. Therefore, operation 307 is optional.

In the screen display method 6200, the control region is displayed onthe second display. The control region includes a control key grouprelated to system control and/or the control key group related to theoperation performed by the user on the operation interface of the targetapplication. In this way, the user can operate the system or the targetapplication on the first display by using the control region on thesecond display. With support of the control region, the user does notneed to repeatedly move a location of a cursor on the first display andrepeatedly locate an operation object or the control key. This greatlysimplifies a user operation. The control region is displayed on thesecond display. Compared with the first display, the second display iscloser to two hands of the user, and can provide a more convenientoperation for the user. In addition, after a related control key groupis displayed in the control region, the related control key group is notdisplayed on the first display, so that a display area on the firstdisplay can be saved. In this way, display content on the first displayis expanded, or display content on the first display is added. Thisimproves user experience.

Refer to FIG. 71 . In an embodiment of the present invention, a screendisplay method 7100 is provided. The screen display method is used tochange display content of an application control bar in a control regionbased on a current operation of a user on a target application. Thescreen display method 7100 may include the following operations.

Operation 7101: Obtain the Operation Performed by the User on the TargetApplication.

After the control region is enabled, the current user operation on thetarget application is detected in real time, and a control key groupdisplayed in the application control bar is changed based on the currentuser operation on the target application.

As described in operation 6202, in an embodiment, the current operationperformed by the user on the target application may be displaying anoperation interface of the target application on a first display. Whenthe first display displays only the operation interface of the targetapplication and does not display an operation interface of anotherapplication, the control key group displayed in the application controlbar may be completely replaced with a control key group corresponding tothe target application. When the first display includes both theoperation interface of the target application and an operation interfaceof another application, the control key group displayed in theapplication control bar may be partially replaced with a control keygroup corresponding to the target application, or a control key groupcorresponding to the target application is added to the control keygroup displayed in the application control bar. In other words, controlkey groups corresponding to a plurality of applications including thetarget application are all displayed in the application control bar.

As described in operation 6202, in another embodiment, the currentoperation performed by the user on the target application may be anoperation on the operation interface of the target application.Specifically, optionally, before the user performs the operation on theoperation interface of the target application, if a shortcut control keygroup related to a previous operation performed by the user on theoperation interface of the target application is displayed in theapplication control bar, this part and the shortcut control key groupcorresponding to the previous operation are replaced with a shortcutcontrol key group corresponding to the current operation. Before theuser performs the operation on the operation interface of the targetapplication, if only the control key group corresponding to the targetapplication is displayed in the application control bar, the control keygroup corresponding to the target application may be replaced theshortcut control key group related to the current operation of the user,or a shortcut control key group related to the current operation of theuser is added to the control key group corresponding to the targetapplication.

A specific embodiment of operation 7101 is the same as that of operation6202. To avoid repetition, details are not described herein again.

Operation 7102: Change the Control Key Group in the Application ControlBar Based on the User Operation.

Optionally, in an embodiment, the changing the control key group in theapplication control bar based on the user operation may be: adding,based on an original control key group in the application control bar,some control key groups related to the current operation performed bythe user on the target application. For example, when the user startsonly the target application, and does not perform an operation on thetarget application, the application control bar may not include theshortcut operation control key group corresponding to the useroperation. In other words, the initial control key group in theapplication control bar includes only a control key set corresponding tothe target application, and does not include a shortcut operationcontrol key set. When the user performs a first operation on the targetapplication, a shortcut operation control key set corresponding to theuser operation may be added to the application control bar, that is, ashortcut operation control key set related to the first operation of theuser is added to the application control bar.

Optionally, in another embodiment, the changing the control key group inthe application control bar based on the user operation may be:removing, based on an original control key group in the applicationcontrol bar, some control key groups related to the current operationperformed by the user on the target application. For example, when theuser operation changes, that is, when the user performs a secondoperation different from the first operation, a shortcut operationcontrol key set corresponding to the second operation of the user isincluded in the shortcut operation control key set corresponding to thefirst operation of the user, and shortcut operation control keyscorresponding to the second operation of the user is less than shortcutoperation control keys corresponding to the first operation of the user.In this case, a shortcut operation control key group unrelated to thesecond operation in the application control bar may be decreased basedon the second operation performed by the user on the target application.

Optionally, in another embodiment, the changing the control key group inthe application control bar based on the user operation may be partiallyor completely replacing the control key group originally displayed inthe application control bar with a new control key group. For example,when the user operation changes, that is, when the user performs asecond operation different from the first operation, if a correlationbetween the second operation and the first operation is small, ashortcut operation control key group related to the first operation ofthe user in the application control bar may be partially or completelyreplaced with a shortcut operation control key group related to thesecond operation of the user.

Optionally, if the current operation performed by the user on the targetapplication corresponds to a large quantity of shortcut operationcontrol keys, the application control bar is crowded, or all shortcutoperation control keys cannot be completely displayed. For example,based on the current operation performed by the user on the targetapplication, one control key group needs to be added to the applicationcontrol bar, or a quantity of control keys used to replace the controlkey group originally displayed in the application control bar is greaterthan a quantity of control keys originally displayed. In this case, adisplay area of the application control bar and a display area of thecontrol region may be adaptively increased, so that the applicationcontrol bar displays all shortcut operation control keys correspondingto the current operation performed by the user on the targetapplication. When more control keys need to be displayed in theapplication control bar, the display area of the application control baris adaptively increased, so that display of the application control barcan be optimized, and display of the control keys in the applicationcontrol bar is not excessively small. This provides better operationexperience for the user.

Optionally, if the current operation performed by the user on the targetapplication corresponds to a small quantity of shortcut operationcontrol keys, there is an idle display region in the application controlbar. For example, based on the current operation performed by the useron the target application, one control key group needs to be removedfrom the application control bar, or a quantity of control keys used toreplace the control key group originally displayed in the applicationcontrol bar is less than a quantity of control keys originallydisplayed. In this case, a display area of the application control barand a display area of the control region may be adaptively decreased, sothat the display area of the application control bar matches theshortcut operation control key corresponding to the current operationperformed by the user on the target application. When less control keysneed to be displayed in the application control bar, the display area ofthe application control bar is adaptively decreased, so that display ofthe application control bar can be optimized, and there is no idledisplay area in the application control bar. This can save a displaycontrol of the second display, expand a display area of anotherapplication on the second display, and provide better operationexperience for the user.

Operation 7103: Hide Display of the Control Key Group in the ApplicationControl Bar on the First Display.

Preferably, after the control key group in the application control baris changed based on the user operation, display of the control key inthe application control region may be hidden on the first display. Aspecific embodiment is described in operation 6205.

In the screen display method 7100, a control key displayed in theapplication control bar is changed based on a change of the currentoperation performed by the user on the target application, so that acontrol key group corresponding to the current operation performed bythe user on the target application is displayed in the applicationcontrol bar in real time. This meets an operation requirement of theuser to a maximum extent, provides a more efficient operation for theuser, and improves user operation efficiency.

It should be noted that a quantity of times of performing operations7101 to 7103 is not limited in this embodiment of the present invention.That is, a change of the current operation performed by the user on thetarget application may be obtained for a plurality of times, and thecontrol key group displayed in the application control bar may bechanged for a plurality of times.

It should be noted that, optionally, in addition to operations 7101 to7103, the screen display method 7100 may further include one or moreoperations in the screen display method 6200. A specific embodiment ofthe one or more operations is described in the screen display method6200. To avoid repetition, details are not described herein again.

Refer to FIG. 72 . An embodiment of the present invention provides ascreen display method 7200. The screen display method is used to changea display area of an application control bar and a control key group inthe application control bar based on an operation of changing thedisplay area of the application control bar by a user. The screendisplay method 7200 may include the following operations.

Operation 7201: Obtain an Operation of Indicating to Change the DisplayArea of the Application Control Bar by the User.

A requirement of the user in a process of using a terminal usuallychanges in real time. In some cases, the user may expect that morecontrol keys are displayed in the application control bar in a controlregion, so that the user is better assisted in operation, for example,when the user performs a complex operation on a target application. Inthis case, increasing the display area of the application control barcan provide more control keys for the user, and improve user operationefficiency. In some other cases, the user may expect that fewer controlkeys are displayed in the application control bar in a control region,for example, when the user simultaneously performs another operation ona second display, but the user expects to provide a larger displayinterface for another application, or when the user performs a simpleoperation on a target application. In this case, decreasing the displayarea of the application control bar can save display space on the seconddisplay, and decreasing the control keys in the application control barallows the user to locate a required control key more simply andquickly. This can improve user operation efficiency and improve userexperience.

The user may implement an objective of changing the display area of theapplication control bar in a plurality of manners. In an embodiment, theuser may indirectly change the display area of the application controlbar by changing a display area of the control region. For example, asshown in FIG. 73A, the display area of the control region may beexpanded by using a zoom-in key in the control region, to indirectlyexpand the display area of the application control bar. The area of thecontrol region may be reduced by using a zoom-out key in the controlregion, to indirectly reduce the display area of the application controlbar. In addition, as shown in FIG. 73B, the display area of the controlregion may be expanded through a zoom-in gesture, to indirectly expandthe display area of the application control bar. As shown in FIG. 73C,the display area of the control region may be reduced through a zoom-outgesture, to indirectly reduce the display area of the applicationcontrol bar. In another embodiment, the user may change a display areaof another application on the second display, to indirectly change thedisplay area of the control region and to further change the displayarea of the application control bar. For example, as shown in FIG. 74A,the display area of the another application may be expanded by using azoom-in key on the another application on the second display, toindirectly reduce the display area of the control region and to furtherreduce the display area of the application control bar. The display areaof the another application may be reduced by using a zoom-out key on theanother application on the second display, to indirectly expand thedisplay area of the control region and the display area of theapplication control bar. In addition, as shown in FIG. 74B, the user mayzoom out another application interface on the second display through thezoom-out gesture, to expand the display area of the control region andthe display area of the application control bar. As shown in FIG. 74C,the user may zoom in another application interface on the second displaythrough the zoom-in gesture, to reduce the display area of the controlregion and the display area of the application control bar. In anotherembodiment, the user may directly perform an operation on theapplication control bar to change the display area of the applicationcontrol bar. For example, as shown in FIG. 75A, the display area of theapplication control bar may be expanded by using a zoom-in key in theapplication control bar. The display area of the application control barmay be reduced by using a zoom-out key in the application control bar.In addition, as shown in FIG. 75B, the user may expand the display areaof the application control bar through the zoom-in gesture. As shown inFIG. 75C, the user may reduce the display area of the applicationcontrol bar through the zoom-out gesture.

In another embodiment, the display area of the application control barmay alternatively be changed based on an operation performed by the useron an application on a first display. Specifically, when a quantity ofcontrol keys corresponding to a current user operation is greater than aquantity of control keys corresponding to a previous user operation, todisplay all control keys in the application control bar and ensure adisplay effect of the control keys in the application control bar, thedisplay area of the application control bar may be appropriatelyexpanded. For example, the previous user operation is starting aspecific application. An initial control key corresponding to theapplication may be displayed in the application control bar, and thecurrent user operation is an operation performed on a target applicationinterface. In this case, a control key for the current user operationmay be added to the application control bar, and the display area of theapplication control bar may be appropriately expanded. When a quantityof control keys corresponding to a current operation is less than aquantity of control keys corresponding to a previous user operation, thedisplay area of the application control bar may be appropriatelyreduced, to save a display area of the second display.

In another embodiment, the display area and a location of the controlregion may flexibly adapt to a change of display of another functionalmodule on the second display. The display area of the applicationcontrol bar is also simultaneously adjusted with a change of the displayarea and the location of the control region. For example, when the usertriggers different types of virtual keyboards through differentgestures, the display area and location of the control region may beflexibly determined based on display regions of the different types ofvirtual keyboards. For a specific embodiment of triggering the differenttypes of virtual keyboards based on the different gestures, refer toEmbodiment 2. Details are not described herein again.

In another embodiment, when the user indicates to enable a handwritinginput mode of the target application, the target application interfaceis displayed on the second display, so that the user may performhandwriting input by using the second display. Optionally, in anembodiment, the application control bar may be displayed on the seconddisplay, and a control key related to the handwriting input mode isdisplayed in the application control bar. In another embodiment, becausethe target application interface is already displayed on the seconddisplay, the application control bar may not be displayed on the seconddisplay. For a specific embodiment of switching between the handwritinginput mode and a virtual keyboard input mode, refer to Embodiment 3.Details are not described herein.

In another embodiment, when the user switches an input mode to thehandwriting input mode, a handwriting input region may be displayed inthe application control bar. Alternatively, a control key group relatedto the handwriting input mode may be displayed in the applicationcontrol bar, for example, pen, eraser, color, and font. Alternatively,the handwriting input region and the control key group related to thehandwriting input mode may be both displayed in the application controlbar. In this way, the user can perform handwriting input by using theapplication control bar, and/or operate the handwriting input mode byusing the application control bar. This improves operation efficiency.For a specific embodiment related to switching of the handwriting inputmode, refer to Embodiment 3. Details are not described herein again.

Operation 7202: Change the Display Area and a Control Key Set of theApplication Control Bar Based on the User Operation.

When the user operation indicates to expand the display area of theapplication control bar, the display area of the application control baris expanded based on a degree of the user operation. For example, whenthe user expands the display area by tapping the zoom-in key, a degreeto which the display area of the application control bar is to beexpanded may be determined based on a quantity of taps of the user. Whenthe user expands the display area through the zoom-in gesture, a degreeto which the display area of the application control bar is to beexpanded may be determined based on a degree of the zoom-in gesture ofthe user.

As shown in FIG. 76A-1 to FIG. 76A-3 , when the display area of theapplication control bar is expanded, a control key in a control keygroup corresponding to the target application may be added in theapplication control bar. Optionally, in an embodiment, when the displayarea of the application control bar is expanded, a control key in anoriginal functional module in the application control bar may be added.In another embodiment, when the display area of the application controlbar is expanded, a new functional module and a corresponding control keyset may be added to the application control bar. In another embodiment,when the display area of the application control bar is expanded, acontrol key in an original functional module and a new functional moduleand a corresponding control key set in the application control bar maybe both added.

As described in the operation 6202, in an embodiment, the system mayadd, based on priorities of functional modules and control keys and in adescending order of priorities, some control keys based on the controlkey set displayed by the application control bar, and determine a layoutof the application control bar after the control keys are added.Preferably, when the display area of the application control bar isexpanded, as shown in FIG. 76A-1 to FIG. 76A-3 , the control key grouporiginally displayed in the application control bar can be moveddownward, and a newly added control key group is displayed above thecontrol key group originally displayed in the application control bar.That is, compared with the control key group originally displayed in theapplication control bar, the newly added control key group is closer tothe first display in the application control bar with the expandeddisplay area. In this embodiment, a priority of the newly added controlkey group is lower than that of the control key group originallydisplayed in the application control bar. Based on the foregoingsetting, when the display area of the application control bar isexpanded, a control key with a higher priority (a control key that has amore important function or that is more frequently used by the user) canbe always disposed at a location closer to two hands of the user. Thisprovides a more convenient operation for the user and improves useroperation efficiency.

In another embodiment, the system may select, based on the display areaof the application control bar, a display manner of the applicationcontrol bar that is provided by an application and that corresponds tothe display area, to perform display in the control region.

Preferably, when the display area of the application control bar isexpanded so that control keys corresponding to the target application inthe application control bar increase, display of the added control keyson the first display may be hidden. A specific embodiment and abeneficial effect are described in operation 6205.

When the user operation indicates to reduce the display area of theapplication control bar, the display area of the application control baris reduced based on a degree of the user operation. For example, whenthe user expands the display area by tapping the zoom-in key, a degreeto which the display area of the application control bar is to beexpanded may be determined based on a quantity of taps of the user. Whenthe user reduces the display area through the zoom-out gesture, a degreeto which the display area of the application control bar is to bereduced may be determined based on a degree of the zoom-out gesture ofthe user.

As shown in FIG. 76B-1 to FIG. 76B-3 , when the display area of theapplication control bar is reduced, the control key in the control keygroup corresponding to the target application in the application controlbar may be decreased. Optionally, in an embodiment, when the displayarea of the application control bar is reduced, a quantity of functionalmodules in the application control bar may be kept unchanged, and aquantity of control keys in the functional module is reduced. In anotherembodiment, when the display area of the application control bar isreduced, the functional module and the corresponding control key set inthe application control bar may be decreased. In another embodiment,when the display area of the application control bar is reduced, thefunctional module, the corresponding control key set, and a quantity ofcontrol keys in another reserved functional module in the applicationcontrol bar may all be decreased.

As described in the operation 6202, in an embodiment, the system maydecrease, based on priorities of functional modules and control keys inan ascending order of priorities, some control keys based on the controlkey set displayed by the application control bar, and determine a layoutof the application control bar after the control keys are decreased. Inanother embodiment, the system may select, based on the display area ofthe application control bar, the display manner of the applicationcontrol bar that is provided by the application, to perform display inthe control region.

Preferably, when the display area of the application control bar isreduced so that the control keys corresponding to the target applicationin the application control bar decrease, display of the decreasedcontrol keys on the first display may be restored. In this case, whenthe user needs to use these control keys, the user can perform anoperation on the first display in a conventional manner through atouchscreen gesture or a mouse operation.

In the screen display method 7200, the display area of the applicationcontrol bar and the control key group in the application control bar arechanged based on an operation of indicating to change the display areaof the target application control bar by the user. This allows moreflexible display of the control region, meets different use requirementsof the user in different use scenarios, and improves user experience.

In addition, when the display area of the application control bar isadjusted, a display area of another display region (such as a systemcontrol bar) in the control region or a display layout of anotherdisplay module (such as a display interface of another application orthe virtual keyboard) on the second display may be adaptively adjusted.

In addition, to help the user quickly locate a to-be-located control keywithout moving a line of sight to the second display, especially if thedisplay area and a display key in the control region change, theto-be-located control key can still be quickly located, an anchor pointfeedback technology may be introduced to the control region. In anembodiment, when the user touches the control key in the applicationcontrol bar, feedback may be provided for the user, to indicate that theuser touches the control key in the application control bar. In anotherembodiment, when the user touches a control key in the system controlbar, feedback may be provided for the user, to indicate that the usertouches the control key in the system control bar. In another possibleembodiment, some control keys that have important functions or that arefrequently used by the user in the application control bar or the systemcontrol bar may be set as anchor point feedback keys, so that the userquickly locates these important or frequently used control keys. For aspecific embodiment of the anchor point feedback, refer to Embodiment 1.Details are not described herein again.

It should be noted that this embodiment of the present invention doesnot limit a quantity of times of performing operation 7201 and operation7202. The user may perform an operation of changing the display area ofthe application control bar for a plurality of times. The system mayobtain in real time the operation that the user indicates to change thedisplay area of the application control bar, and change the display areaof the application control bar and the control key group in theapplication control bar for a plurality of times based on the useroperation.

It should be noted that, optionally, in addition to operations 7201 and7202, the screen display method 7200 may further include one or moreoperations in the screen display method 6200. A specific embodiment ofthe one or more operations is described in the screen display method6200. To avoid repetition, details are not described herein again.

The control region displayed on the second display has an outputfunction, that is, is used as a human-computer interaction interface todisplay a set of some control keys of the target application to theuser. In addition, the control region may further have some inputfunctions, for example, a touchscreen gesture function, to receive inputof the user, to further perform some operations on the targetapplication or perform some operations on the control region.

In an embodiment, the control region may receive input of the user, toimplement control on the target application function. For example, whenthe target application is mainly used to edit a document, a control keyset in the control region corresponding to the target application mayinclude a control key for processing text content, such as copy, paste,and cut. In this case, the text content may be edited by tapping acontrol key in the control region through a touchscreen gesture orselecting a control key in the control region by using a mouse. When thetarget application is mainly used to play video content, a control keyset in the control region corresponding to the target application mayinclude a control key for controlling the video content, such as avolume control key, a brightness control key, or a progress control bar.In this case, volume, brightness, playback progress, and the like of avideo may be controlled by tapping a corresponding control key in thecontrol region through the touchscreen gesture or selecting thecorresponding control key in the control region by using the mouse. Itshould be understood that the target application and the control keysfor operating the target application are examples, and another commontarget application and a common control key in the art are alsopossible.

In another embodiment, the user may operate the target application onthe first display by using the control key set in the control region andin another input mode. For example, the user may select a specificobject on an editing page by using the mouse or the touchscreen gestureon the first display, and edit the selected object by using the controlkey set in the control region. It should be understood that cooperativecontrol based on the control key set in the control region and the mouseor the touchscreen gesture is only an example, and another possiblecooperative mode that can implement an operation on the targetapplication on the first display is also possible.

In an embodiment of the present invention, a user may view, edit, andcustomize the control key set in the control region. In an embodiment,the control region may support the following touchscreen gestureoperations of the user:

(1) Touchscreen Gesture Operation

In an embodiment, the operation may be performed on the control regionthrough a drag gesture. For example, the drag gesture may be used todrag a control key at a specific location in the control region toanother location in the control region, as shown in FIG. 77A. The draggesture may be further used to drag a functional module in the controlregion as a whole to another location in the control region. As shown inFIG. 77B, the drag gesture may be further used to move a location of theentire control region on the second display.

In another embodiment, the operation may be performed on the controlregion through a slide gesture. For example, the slide gesture may beused to browse display content in the control region. For example, whena specific functional module does not display all control keys due to alimitation of the display area of the control region, a control key thatis not displayed in the functional module may be browsed through theslide gesture, as shown in FIG. 77C.

In another embodiment, the operation may be performed on the controlregion through a flick gesture. For example, the flick gesture may beused to remove some content from the control region, as shown in FIG.77D.

(2) Finger-Press Gesture Operation

The operation may be performed on the control region through a fingerpress gesture. When the finger press gesture of the user is received atdifferent locations in the control region, different functions may becorrespondingly performed. As shown in FIG. 78A, in an embodiment, ifthe finger press gesture of the user is received on a control key in thecontrol region, a delete key of the current control key may bedisplayed, and the control key is deleted by using the delete key. Inaddition, after the control key is deleted, a corresponding displaylocation may be displayed as null, and an add key is displayed. The usermay add a new control key to the location by using the add key. As shownin FIG. 78B, if the finger press gesture is received at a boundary ofdifferent functional modules, a function of moving an edge of twofunctional modules divided by the boundary may be triggered. The usermay drag the boundary to change display areas of the two functionalmodules. Specifically, a display area of one functional module isincreased, and a display area of the other functional module isdecreased. Based on a priority sequence of control keys in the twofunctional modules, control keys displayed in the functional module withthe increased display area may be increased, and control keys displayedin the functional module with the decreased display area may bedecreased.

(3) Floating Gesture Operation

The operation may be performed on the control region through a floatinggesture. The floating gesture may be used to perform a previewoperation. For example, as shown in FIG. 79 , the floating gestureoperation may be used to view content such as a name and an auxiliaryprompt of a current control key. The floating gesture operation may beused to preview a control key that is not displayed in the currentcontrol region due to a limitation of the display area.

It should be understood that, the foregoing enumerated touchscreengesture operations are only examples, and another common gestureoperation manner in the art is also possible.

According to the embodiments corresponding to FIG. 60 to FIG. 79 , tobetter reflect the solutions and beneficial effects of the embodimentsof this application, the following provides a specific embodiment.

A note application on a dual-screen electronic device is used as anexample. FIG. 80A shows a general display state. All content related tothe note application is displayed on a first display. For example, FIG.80A may include a main display region of note content and a functionmenu bar such as list navigation and a fixed menu bar. In the generaldisplay state, a user may operate the note application in a generaloperation manner, for example, control the note application by using amouse or a touchscreen gesture on the first display.

When the user needs to enable an auxiliary operation of a control regionon a second display, the user may activate the control region in thefollowing four manners:

-   -   (1) If a virtual keyboard is disabled, the virtual keyboard and        the control region may be simultaneously enabled when an        instruction of the user for enabling the virtual keyboard is        received.    -   (2) If the virtual keyboard is enabled, an instruction of the        user for enabling an application control bar may be received by        using a control key in the control region on the virtual        keyboard, and the control region is enabled.    -   (3) The control region may be enabled when a gesture of enabling        the control region by the user is received.    -   (4) When the note application is not displayed in a full-screen        mode, the control region may be enabled when an instruction of a        full-screen note application of the user is received.

When the system receives an instruction for the user to activate thecontrol region, the system displays, based on the embodiments in themethod embodiment corresponding to the screen display method 6200 and adisplay area of the control region, a corresponding system control keygroup and a control key group corresponding to a target application inthe control region on the second display, and correspondingly reduces adisplay area of another application on the second display. For example,as shown in FIG. 80B, when an initial display area of the control regionis the smallest, only a system control key group related to systemcontrol is displayed in a system control bar in the control region, andsome control key groups corresponding to the target application aredisplayed in the application control bar.

When an operation of changing a display area of the application controlbar by the user is received, for example, as shown in FIG. 80C, when theuser expands the display area of the application control bar through azoom-in gesture, the system expands the display areas of both thecontrol region and the application control bar based on the useroperation, and adds a functional module and a control key group thereofthat correspond to the note application to the application control bar.Similarly, a function menu bar that is originally displayed on the firstdisplay and that corresponds to the functional module is removed. Asshown in FIG. 80D, when the user further expands the display area of theapplication control bar through a zoom-in gesture, the system furtherexpands the display areas of both the control region and the applicationcontrol bar based on the user operation, and adds another functionalmodule and a control key group thereof that correspond to the noteapplication to the application control bar. Similarly, the function menubar that is originally displayed on the first display and thatcorresponds to the functional module is removed.

When the user performs an operation on the target application, forexample, as shown in FIG. 80E, selects a part of text in an operationinterface of the target application, a current user operation on thetarget application is obtained, and a control key group corresponding tothe current user operation on the target application, for example, copy,paste, or cut, is displayed in the application control bar based on theuser operation. When the user changes the current operation on thetarget application, for example, selects some pictures in the operationinterface of the target application, the current user operation on thetarget application is obtained, and a control key group corresponding tothe previous user operation in the application control bar is changed toa control key group corresponding to a next user operation based on theuser operation.

The user may operate the target application on the first display byusing a control key in the control region of the second display. Forexample, as shown in FIG. 80F, the user may select, by tapping a controlkey in the functional module, a specific note to be browsed in the noteapplication, and the user may edit a currently displayed note by tappinga control key in the functional module. In addition, the user mayfurther perform an operation on the application control bar. Forexample, as shown in FIG. 80G, the user may customize and edit displaycontent of the application control bar, or the user may view a name, afunction, or another description of a control key in the control regionthrough a floating gesture.

If the user does not need to use the control region for an auxiliaryoperation, the user can disable the control region in the followingmanners:

-   -   (1) If the virtual keyboard is enabled, the virtual keyboard and        the control region may be simultaneously disabled when an        instruction of the user for disabling the virtual keyboard is        received.    -   (2) If the virtual keyboard is enabled, an instruction of the        user for disabling an application control bar may be received by        using a control key in the control region on the virtual        keyboard, and the control region is disabled.    -   (3) The control region may be disabled when a gesture of        disabling the control region by the user is received.    -   (4) When the note application is displayed in a full-screen        mode, the control region may be disabled when an instruction of        the user for disabling the full-screen display mode is received.

It may be understood that, to implement the foregoing functions, theelectronic device includes corresponding hardware and/or softwaremodules for performing the functions. With reference to the methodoperations of examples described in embodiments disclosed in thisspecification, this application may be implemented in a form of hardwareor a combination of hardware and computer software. Whether a functionis performed by hardware or hardware driven by computer software dependson particular applications and design constraints of the technicalsolution. A person skilled in the art may use different methods toimplement the described functions for each particular application withreference to embodiments, but it should not be considered that theimplementation goes beyond the scope of this application.

In this embodiment, the electronic device may be divided into functionalmodules based on the foregoing method examples. For example, eachfunctional module corresponding to each function may be obtained throughdivision, or two or more functions may be integrated into one processingmodule. The integrated module may be implemented in a form of hardware.It should be noted that module division in this embodiment is an exampleand is merely logical function division. In actual implementation, theremay be another division manner.

When the functional modules are obtained through division based on thecorresponding functions, FIG. 81 is a schematic diagram of a possiblecomposition of the electronic device in the foregoing methodembodiments. As shown in FIG. 81 , the electronic device 8100 mayinclude a first display 8101, a second display 8102, an input module8103, and a processing module 8104.

The first display 8101 may be configured to support the electronicdevice 8100 in displaying a target application interface, and/or beconfigured perform another process of the technology described in thisspecification.

In a dual-screen display electronic device, the first display usuallycarries an output function, that is, displays content such as a state ofa target application and an execution result of a user operation.Optionally, the display content of the first display may include a maindisplay interface of the target application and some function menu bars.In addition, the first display may further carry an input function, andan operation may be performed on the first display through a touchscreengesture, to implement the input function.

The second display 8102 may be configured to support the electronicdevice 8100 in displaying a control region, and/or be configured performanother process of the technology described in this specification.

In a dual-screen display electronic device, in an embodiment, the seconddisplay may carry an input function, that is, receive input of a user.In another embodiment, the second display may alternatively carry anoutput function, that is, display content such as the state of thetarget application and the execution result of the user operation. Theelectronic device 8100 displays the control region on the seconddisplay, so that the user can control the target application on thefirst display by using the control region on the second display. Thisimproves operation efficiency and user experience.

The input module 8103 may be configured to support the electronic device8100 in performing operation 6202 in the screen display method 6200, maybe configured to support the electronic device 8100 in performingoperation 7101 in the screen display method 7100, may be configured tosupport the electronic device 8100 in performing operation 7201 in thescreen display method 7200, and/or is configured to perform anotherprocess of the technology described in this specification.

Specifically, in operation 6202 and operation 7101, the input module isconfigured to receive an operation performed by the user on the targetapplication. In an embodiment, the user may operate the targetapplication by operating a mouse. In this case, the input module may bethe mouse. In another embodiment, the user may operate the targetapplication through a touchscreen gesture. In this case, the inputmodule may be the first display. In another embodiment, the user mayperform an operation on the target application through a mid-airgesture. In this case, the input module may be a depth camera configuredto collect gesture information, or the like. In operation 7201, theinput module is configured to receive an operation of changing thedisplay area of the application control bar by the user. In anembodiment, the user may perform an operation on the second displaythrough a touchscreen gesture, to change the display area of theapplication control bar. In this case, the input module may be thesecond display. In another embodiment, the user may change the displayarea of the application control bar by using the mouse. In this case,the input module may be the mouse. In another embodiment, the user maychange the display area of the application control bar through a mid-airgesture. In this case, the input module may be a depth camera configuredto collect gesture information, or the like.

The processing module 8104 may be configured to support the electronicdevice 8100 in performing operations 6201, 6203, 6204, 6205, and 6206 inthe screen display method 6200, may be configured to support theelectronic device 8100 in performing operations 7102 and 7103 in thescreen display method 7100, may be configured to support the electronicdevice 8100 in performing operation 7202 in the screen display method7200, and/or is configured to perform another process of the technologydescribed in this specification.

The processing module may be a processor or a controller. The processormay implement or execute various example logical blocks, modules, andcircuits described with reference to content disclosed in thisapplication. The processor may be alternatively a combination forimplementing a computing function, for example, a combination includingone or more microprocessors or a combination of a digital signalprocessor (DSP) and a microprocessor.

It should be noted that content such as information exchange and anexecution process between the modules/units in the electronic device8100 is based on a same concept as the method embodiments correspondingto FIG. 60 to FIG. 79 in this application. For specific content, referto the descriptions in the foregoing method embodiments in thisapplication. Details are not described herein again.

For example, FIG. 82 is a schematic diagram of a structure of anelectronic device 8200. The electronic device 8200 may be specificallyrepresented as a dual-screen electronic device, for example, a notebookcomputer, an ultra-mobile personal computer (UMPC), a netbook, or apersonal digital assistant (PDA) that have two displays or curvedscreens or have a flexible folding screen. Alternatively, the electronicdevice may be represented as two electronic devices that are connectedand used synchronously, for example, two tablet computers or two mobilephones. A specific type of an electronic device having two displays isnot limited in this embodiment of this application.

The electronic device 8200 may include a processor 8210, an externalmemory interface 8220, an internal memory 8221, a universal serial bus(USB) port 8230, a charging management module 8240, a power managementmodule 8241, a battery 8242, an antenna 1, an antenna 2, a mobilecommunication module 8250, a wireless communication module 8260, anaudio module 8270, a speaker 8270A, a receiver 8270B, a microphone8270C, a headset jack 8270D, a sensor module 8280, a button 8290, amotor 8291, an indicator 8292, a camera 8293, a display 8294, asubscriber identity module (SIM) card interface 8295, and the like. Thesensor module 8280 may include a pressure sensor 8280A, a gyro sensor8280B, a barometric pressure sensor 8280C, a magnetic sensor 8280D, anacceleration sensor 8280E, a distance sensor 8280F, an optical proximitysensor 8280G, a fingerprint sensor 8280H, a temperature sensor 8280J, atouch sensor 8280K, an ambient light sensor 8280L, a bone conductionsensor 8280M, and the like.

It may be understood that the structure shown in this embodiment of thisapplication does not constitute a specific limitation on the electronicdevice 8200. In some other embodiments of this application, theelectronic device 8200 may include more or fewer components than thoseshown in the figure, or some components may be combined, or somecomponents may be split, or a different component arrangement may beused. The components shown in the figure may be implemented by hardware,software, or a combination of software and hardware.

The processor 8210 may include one or more processing units. Forexample, the processor 8210 may include an application processor (AP), amodem processor, a graphics processing unit (GPU), an image signalprocessor (ISP), a controller, a memory, a video codec, a digital signalprocessor (DSP), a baseband processor, a neural-network processing unit(NPU), and/or the like. Different processing units may be independentcomponents, or may be integrated into one or more processors.

The controller may be a nerve center and a command center of theelectronic device 8200. The controller may generate an operation controlsignal based on instruction operation code and a time sequence signal,to complete control of instruction fetching and instruction execution. Amemory may be further disposed in the processor 8210, and is configuredto store instructions and data. In some embodiments, the memory in theprocessor 8210 is a cache memory. The memory may store instructions ordata that has been recently used or cyclically used by the processor8210. If the processor 8210 needs to use the instructions or the dataagain, the processor may directly invoke the instructions or the datafrom the memory. This avoids repeated access, reduces waiting time ofthe processor 8210, and improves system efficiency.

In some embodiments, the processor 8210 may include one or moreinterfaces. The interface may include an inter-integrated circuit (I2C)interface, an inter-integrated circuit sound (I2S) interface, a pulsecode modulation (PCM) interface, a universal asynchronousreceiver/transmitter (UART) interface, a mobile industry processorinterface (MIPI), a general-purpose input/output (GPIO) interface, asubscriber identity module (SIM) interface, a universal serial bus (USB)port, and/or the like.

The power management module 8241 is configured to connect the battery8242, the charging management module 8240, and the processor 8210. Thepower management module 8241 receives input of the battery 8242 and/orthe charging management module 8240, to supply power to the processor8210, the internal memory 8221, an external memory, the display 8294,the camera 8293, the wireless communication module 8260, and the like.The power management module 8241 may be further configured to monitorparameters such as a battery capacity, a battery cycle count, and abattery state of health (electric leakage or impedance). In some otherembodiments, the power management module 8241 may alternatively beprovided in the processor 8210. In some other embodiments, the powermanagement module 8241 and the charging management module 8240 mayalternatively be provided in a same device.

The electronic device 8200 implements a display function by using theGPU, the display 8294, the application processor, and the like. The GPUis a microprocessor for image processing, and is connected to thedisplay 8294 and the application processor. The GPU is configured to:perform mathematical and geometric computation, and render an image. Theprocessor 8210 may include one or more GPUs that execute programinstructions to generate or change display information.

The display 8294 is configured to display an image, a video, and thelike. The display 8294 includes a display panel. The display panel maybe a liquid crystal display (LCD), an organic light-emitting diode(OLED), an active-matrix organic light-emitting diode (AMOLED), aflexible light-emitting diode (FLED), a mini-LED, a micro-LED, amicro-OLED, a quantum dot light-emitting diode (QLED), or the like. Inthis embodiment of the present invention, the display 8294 is dividedinto a first display and a second display. The first display or thesecond display may have an input function, for example, control thedisplay through a touchscreen gesture.

The external memory interface 8220 may be configured to connect to anexternal memory card, for example, a micro SD card, to extend a storagecapability of the electronic device 8200. The external memory cardcommunicates with the processor 8210 through the external memoryinterface 8220, to implement a data storage function. For example, filessuch as music and videos are stored in the external storage card.

The internal memory 8221 may be configured to store computer-executableprogram code, and the executable program code includes instructions. Theprocessor 8210 runs the instructions stored in the internal memory 8221,to perform various function applications and data processing of theelectronic device 8200. The internal memory 8221 may include a programstorage region and a data storage region. The program storage region maystore an operating system, an application required by one or morefunctions (for example, a sound play function and an image playfunction), and the like. The data storage region may store data (forexample, audio data and a phone book) and the like created when theelectronic device 8200 is used. In addition, the internal memory 8221may include a high-speed random access memory, and may further include anonvolatile memory, for example, one or more magnetic disk storagedevices, a flash memory, a universal flash storage (UFS), or the like.

An embodiment further provides a computer storage medium. The computerstorage medium stores computer instructions, and when the computerinstructions are run on an electronic device, the electronic device isenabled to perform the foregoing related method operations, to implementthe screen display method in the foregoing embodiments.

An embodiment further provides a computer program product. When thecomputer program product is run on a computer, the computer is enabledto perform the foregoing related operations, to implement the screendisplay method in the foregoing embodiments.

In addition, an embodiment of this application further provides anapparatus. The apparatus may be specifically a chip, a component, or amodule. The apparatus may include a processor and a memory that areconnected to each other. The memory is configured to store computerexecutable instructions. When the apparatus runs, the processor mayexecute the computer executable instructions stored in the memory, toenable the chip to perform the screen display method in the foregoingmethod embodiments.

The electronic device, the computer storage medium, the computer programproduct, or the chip provided in embodiments is configured to performthe corresponding method provided above. Therefore, for beneficialeffects that can be achieved, refer to the beneficial effects of thecorresponding method provided above. Details are not described hereinagain.

Based on descriptions about the foregoing embodiments, a person skilledin the art may understand that, for a purpose of convenient and briefdescription, division into the foregoing functional modules is used asan example for illustration. In actual application, the foregoingfunctions may be allocated to different functional modules andimplemented based on a requirement. In other words, an inner structureof an apparatus is divided into different functional modules toimplement all or some of the functions described above.

In the several embodiments provided in this application, it should beunderstood that the disclosed apparatuses and methods may be implementedin other manners. For example, the described apparatus embodiment isonly an example. For example, division into the modules or the units isonly logical function division and may be other division in an actualembodiment. For example, a plurality of units or components may becombined or integrated into another apparatus, or some characteristicsmay be ignored or not performed. In addition, the displayed or discussedmutual couplings or direct couplings or communication connections may beimplemented by using some interfaces. The indirect couplings orcommunication connections between the apparatuses or units may beimplemented in electronic, mechanical, or other forms.

The units described as separate components may or may not be physicallyseparate, and components displayed as units may be one or more physicalunits, may be located in one place, or may be distributed on differentplaces. Some or all of the units may be selected based on actualrequirements to achieve the objectives of the solutions in embodiments.

In addition, functional units in embodiments of this application may beintegrated into one processing unit, each of the units may exist alonephysically, or two or more units are integrated into one unit. Theintegrated unit may be implemented in a form of hardware, or may beimplemented in a form of a software function unit.

When the integrated unit is implemented in the form of a softwarefunctional unit and sold or used as an independent product, theintegrated unit may be stored in a readable storage medium. Based onsuch an understanding, the technical solutions of embodiments of thisapplication essentially, or the part contributing to the conventionaltechnology, or all or some of the technical solutions may be implementedin a form of a software product. The software product is stored in astorage medium and includes several instructions for instructing adevice (which may be a single-chip microcomputer, a chip, or the like)or a processor to perform all or some of the operations of the methodsdescribed in embodiments of this application. The foregoing storagemedium includes any medium that can store program code, such as a USBflash drive, a removable hard disk, a read-only memory (ROM), a randomaccess memory (RAM), a magnetic disk, or an optical disc.

The foregoing descriptions are only specific embodiments of thisapplication, but are not intended to limit the protection scope of thisapplication. Any variation or replacement readily figured out by aperson skilled in the art in the technical scope disclosed in thisapplication should fall within the protection scope of this application.Therefore, the protection scope of this application should be subject tothe protection scope of the claims.

1. A feedback method, comprising: detecting a first contact operationacting on a touchscreen of an electronic device; obtaining, in responseto the first contact operation, first location information of a firstcontact point corresponding to the first contact operation, wherein thefirst location information corresponds to a first virtual key on avirtual keyboard; when the first virtual key is an anchor point key,obtaining a first vibration feedback element from a plurality ofvibration feedback elements of the touchscreen, wherein the firstvibration feedback element is a vibration feedback element that matchesthe first virtual key; and indicating the first vibration feedbackelement to emit a vibration wave, to perform a first feedback operation,wherein the first feedback operation to prompts the first virtual key isthe anchor point key.
 2. The method according to claim 1, wherein afirst mapping relationship is configured for the electronic device thatindicates a correspondence between virtual keys and vibration feedbackelements, and the obtaining the first vibration feedback element fromthe plurality of vibration feedback elements comprises: obtaining thefirst vibration feedback element based on the first mapping relationshipand the first virtual key.
 3. The method according to claim 21, whereina first mapping relationship is configured for the electronic devicethat indicates a correspondence between location information andvibration feedback elements, and the obtaining the first vibrationfeedback element from the plurality of vibration feedback elementscomprises: obtaining the first vibration feedback element based on thefirst mapping relationship and the first location information.
 4. Themethod according to claim 1, wherein before the indicating the firstvibration feedback element to emit the vibration wave, the methodfurther comprises: obtaining a vibration intensity of a vibration wavecorresponding to each of at least one first vibration feedback element,wherein the vibration intensity of the vibration wave of each of the atleast one first vibration feedback element is related to a firstquantity, and the first quantity is a quantity of the first vibrationfeedback elements; and wherein the first vibration feedback element toemit the vibration wave comprises: emitting, based on the vibrationintensity of the vibration wave corresponding to each first vibrationfeedback element, the vibration wave using the at least one firstvibration feedback element, so that a difference between a vibrationfeedback intensity corresponding to the first virtual key and avibration feedback intensity corresponding to a second virtual key fallswithin a preset intensity range, wherein the second virtual key and thefirst virtual key are different virtual keys.
 5. The method according toclaim 1, wherein the first vibration feedback element is one of: apiezoelectric ceramic sheet, a linear motor, or a piezoelectric film. 6.The method according to claim 1, wherein before the performing the firstfeedback operation, the method further comprises: obtaining, based onthe first location information, a location type corresponding to thefirst contact point, wherein the location type comprises that the firstcontact point is located in a first location region of the first virtualkey and the first contact point is located in a second location regionof the first virtual key, and the first location region is differentfrom the second location region; and performance of the first feedbackoperation comprises: performing the first feedback operation by usingthe touchscreen based on the location type corresponding to the firstcontact point, wherein a feedback operation corresponding to the firstlocation region is different from a feedback operation corresponding tothe second location region.
 7. The method according to claim 1, whereinbefore the detecting the first contact operation acting on thetouchscreen, the method further comprises: selecting, in response to adetected first gesture operation, a first type of virtual keyboardcorresponding to the first gesture operation from a plurality of typesof virtual keyboards, wherein virtual keys comprised in different typesof virtual keyboards in the plurality of types of virtual keyboards arenot completely the same; and displaying the first type of virtualkeyboard by using the touchscreen, wherein a location of the first typeof virtual keyboard on the touchscreen is fixed in the process ofdisplaying the first type of virtual keyboard; and the detecting thefirst contact operation acting on the touchscreen comprises: detectingthe first contact operation acting on the touchscreen in the process ofdisplaying the first type of virtual keyboard.
 8. An electronic device,comprising: a touchscreen comprising a tactile sensing module and avibration feedback module, and the vibration feedback module comprises aplurality of vibration feedback elements; the tactile sensing module isconfigured to obtain first location information of a first contact pointon the touchscreen; a first vibration feedback element is configured toemit a vibration wave when a first virtual key corresponding to thefirst contact point is an anchor point key, wherein the vibration waveprompts the first virtual key is the anchor point key; and the firstvirtual key is a virtual key on a virtual keyboard, and the firstvibration feedback element is a vibration feedback element that matchesthe first virtual key in the plurality of vibration feedback elements.9. The device according to claim 8, wherein the touchscreen furthercomprises a cover and an ultrasonic module, and the ultrasonic module isconfigured to emit an ultrasonic wave to change a tactile characteristicof the cover; or the touchscreen further comprises a cover and anelectrostatic module, and the electrostatic module is configured togenerate an electrical signal to change a tactile characteristic of thecover; and the tactile characteristic comprises one or more of thefollowing characteristics: a sliding friction coefficient, a stick slipproperty, and a temperature.
 10. The device according to claim 8,wherein the touchscreen further comprises a pressure sensing module, thepressure sensing module and the vibration feedback module areintegrated, and the vibration feedback element is a piezoelectricceramic sheet, a piezoelectric polymer, or a piezoelectric composite.11. An electronic device, wherein the electronic device comprises atouchscreen, a memory, one or more processors, and one or more programs,the touchscreen is provided with a plurality of vibration feedbackelements, the one or more programs are stored in the memory, and whenthe one or more processors execute the one or more programs, theelectronic device is enabled to perform operations, comprising:detecting a first contact operation acting on the touchscreen;obtaining, in response to the first contact operation, first locationinformation of a first contact point corresponding to the first contactoperation, wherein the first location information corresponds to a firstvirtual key on the virtual keyboard; when the first virtual key is ananchor point key, obtaining a first vibration feedback element from theplurality of vibration feedback elements, wherein the first vibrationfeedback element is a vibration feedback element that matches the firstvirtual key; and indicating the first vibration feedback element to emita vibration wave, to perform a first feedback operation, wherein thefirst feedback operation prompts the first virtual key is the anchorpoint key.
 12. The electronic device according to claim 11, wherein afirst mapping relationship is configured for the electronic device thatindicates a correspondence between virtual keys and vibration feedbackelements, when the one or more processors execute the one or moreprograms, the electronic device is enabled to perform the followingoperation: obtaining the first vibration feedback element based on thefirst mapping relationship and the first virtual key.
 13. The electronicdevice according to claim 11, wherein a first mapping relationship isconfigured for the electronic device that indicates a correspondencebetween location information and vibration feedback elements, when theone or more processors execute the one or more programs, the electronicdevice is enabled to perform the following operation: obtaining thefirst vibration feedback element based on the first mapping relationshipand the first location information.
 14. The electronic device accordingto claim 11, wherein when the one or more processors execute the one ormore programs, the electronic device is enabled to further perform thefollowing operations: obtaining a vibration intensity of a vibrationwave corresponding to each of at least one first vibration feedbackelement, wherein the vibration intensity of the vibration wave of eachof the at least one first vibration feedback element is related to afirst quantity, and the first quantity is a quantity of the firstvibration feedback elements; and emitting, based on the vibrationintensity of the vibration wave corresponding to each first vibrationfeedback element, the vibration wave using the at least one firstvibration feedback element, so that a difference between a vibrationfeedback intensity corresponding to the first virtual key and avibration feedback intensity corresponding to a second virtual key fallswithin a preset intensity range, and the second virtual key and thefirst virtual key are different virtual keys.
 15. The electronic deviceaccording to claim 11, wherein the first vibration feedback element isone of: a piezoelectric ceramic sheet, a linear motor, or apiezoelectric film.
 16. The electronic device according to claim 11,wherein when the one or more processors execute the one or moreprograms, the electronic device is enabled to further perform thefollowing operations: obtaining, based on the first locationinformation, a location type corresponding to the first contact point,wherein the location type comprises that the first contact point islocated in a first location region of the first virtual key and thefirst contact point is located in a second location region of the firstvirtual key, and the first location region is different from the secondlocation region; and performing the first feedback operation by usingthe touchscreen based on the location type corresponding to the firstcontact point, wherein a feedback operation corresponding to the firstlocation region is different from a feedback operation corresponding tothe second location region.
 17. The electronic device according to claim11, wherein when the one or more processors execute the one or moreprograms, the electronic device is enabled to further perform thefollowing operations: selecting, in response to a detected first gestureoperation, a first type of virtual keyboard corresponding to the firstgesture operation from a plurality of types of virtual keyboards,wherein virtual keys comprised in different types of virtual keyboardsin the plurality of types of virtual keyboards are not completely thesame; displaying the first type of virtual keyboard by using thetouchscreen, wherein a location of the first type of virtual keyboard onthe touchscreen is fixed in the process of displaying the first type ofvirtual keyboard; and detecting the first contact operation acting onthe touchscreen in the process of displaying the first type of virtualkeyboard.
 18. A computer program product, comprising instructions, whichwhen loaded and executed by an electronic device, the electronic deviceis enabled to perform the method according to claim
 1. 19. An electronicdevice, comprising a processor, wherein the processor is coupled to amemory, the memory stores program instructions, and when the programinstructions stored in the memory are executed by the processor, themethod according to claim 1 is performed.